def testSetQueryItems(self): urla = QUrl('http://www.google.com/search?q=python&hl=en') urlb = QUrl('http://www.google.com/search') urlb.setQuery(urla.query()) self.assertEqual(urla, urlb)
def testEncodedQueryItems(self): url = QUrl('http://www.google.com/search?q=python&hl=en') valid_data = [(('q'), ('python')), (('hl'), ('en'))] self.assertEqual(sorted(QUrlQuery(url.query()).queryItems()), sorted(valid_data))