def test_location_autosuggest_xml(self): transport = Transport(self.api_key, response_format='xml') self.result = transport.location_autosuggest(query='BER', market='DE', currency='EUR', locale='de-DE').parsed self.assertTrue(None != self.result.find('./Places')) self.assertTrue(len(self.result.findall('./Places/PlaceDto')) > 0)
def cityDecoder(city): flights_locale = Transport('ha306082955374085267757354385037') result = flights_locale.location_autosuggest( market='ES', currency='eur', locale='en-GB', query = city).parsed return result
def test_location_autosuggest_xml(self): transport = Transport(self.api_key, response_format='xml') self.result = transport.location_autosuggest(query='BER', market='DE', currency='EUR', locale='de-DE').parsed self.assertIsNotNone(self.result.find('./Places')) self.assertTrue(len(self.result.findall('./Places/PlaceDto')) > 0)
def test_location_autosuggest_json(self): transport = Transport(self.api_key, response_format='json') self.result = transport.location_autosuggest(query='KUL', market='UK', currency='GBP', locale='en-GB').parsed self.assertTrue('Places' in self.result) self.assertTrue(len(self.result['Places']) > 0)
def city_string_to_id(city_as_str): transport_service = Transport(API_KEY) city_suggestion_results = transport_service.location_autosuggest( **{ 'market': 'ES', 'currency': 'EUR', 'locale': 'en-GB', 'query': city_as_str }).json()['Places'] if not city_suggestion_results: return None else: return city_suggestion_results[0]['PlaceId']
def test_location_autosuggest(self): transport = Transport(self.api_key) self.result = transport.location_autosuggest('KUL', 'UK', 'GBP', 'en-GB') self.assertTrue('Places' in self.result) self.assertTrue(len(self.result['Places']) > 0)
def test_location_autosuggest_xml(self): transport = Transport(self.api_key, response_format="xml") self.result = transport.location_autosuggest(query="BER", market="DE", currency="EUR", locale="de-DE").parsed self.assertTrue(None != self.result.find("./Places")) self.assertTrue(len(self.result.findall("./Places/PlaceDto")) > 0)
def test_location_autosuggest_json(self): transport = Transport(self.api_key, response_format="json") self.result = transport.location_autosuggest(query="KUL", market="UK", currency="GBP", locale="en-GB").parsed self.assertTrue("Places" in self.result) self.assertTrue(len(self.result["Places"]) > 0)