Пример #1
0
    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)
Пример #2
0
    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))