Exemplo n.º 1
0
    def _do_conditions(self):
        service = AccuWeatherService(ServiceConfiguration.from_data("rest", "accuweather", "weather"))
        self.assertIsNotNone(service)

        client = AccuWeatherServiceTestClient()
        service.initialise(client)

        response = service.conditions("3385695")
        self.assertResponse(response, 'conditions', 'accuweather', 'weather')
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)