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]))
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]))
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))