def _do_textsearch(self): service = AccuWeatherService(ServiceConfiguration.from_data("rest", "accuweather", "weather")) self.assertIsNotNone(service) client = AccuWeatherServiceTestClient() service.initialise(client) response = service.textsearch("Kinghorn") self.assertResponse(response, 'textsearch', 'accuweather', 'weather') key = AccuWeatherService.get_location_key(response) self.assertIsNotNone(key) self.assertEquals("3385695", key)
def _do_postcodesearch(self): service = AccuWeatherService(ServiceConfiguration.from_data("rest", "accuweather", "weather")) self.assertIsNotNone(service) client = AccuWeatherServiceTestClient() service.initialise(client) response = service.postcodesearch("KY3 9UR") self.assertResponse(response, 'postcodesearch', 'accuweather', 'weather') key = AccuWeatherService.get_location_key(response) self.assertIsNotNone(key) self.assertEquals("47724_PC", key)