Exemple #1
0
    def testAllEncodedQueryItemsValues(self):
        #QUrl.allEncodedQueryItemValues
        url = QUrl()
        key = 'key'
        valid_data = ['data', 'valid', 'test']

        for i, data in enumerate(valid_data):
            url.addQueryItem(key, data)
            self.assertEqual(url.allEncodedQueryItemValues(key),
                             list(valid_data[:i + 1]))
Exemple #2
0
    def testAllEncodedQueryItemsValues(self):
        #QUrl.allEncodedQueryItemValues
        url = QUrl()
        key = 'key'
        valid_data = ['data', 'valid', 'test']

        for i, data in enumerate(valid_data):
            url.addQueryItem(key, data)
            self.assertEqual(url.allEncodedQueryItemValues(key),
                             list(valid_data[:i+1]))
Exemple #3
0
    def testAddQueryItem(self):
        #QUrl.addQueryItem
        url = QUrl()
        valid_data = [('hl', 'en'), ('user', 'konqui')]

        url.addQueryItem(*valid_data[0])
        self.assertEqual(url.queryItems()[0], valid_data[0])

        url.addQueryItem(*valid_data[1])
        self.assertEqual(sorted(url.queryItems()), sorted(valid_data))
Exemple #4
0
    def testAddQueryItem(self):
        #QUrl.addQueryItem
        url = QUrl()
        valid_data = [('hl', 'en'), ('user', 'konqui')]

        url.addQueryItem(*valid_data[0])
        self.assertEqual(url.queryItems()[0], valid_data[0])

        url.addQueryItem(*valid_data[1])
        self.assertEqual(sorted(url.queryItems()), sorted(valid_data))