Beispiel #1
0
 def test_invalid_param(self):
     client = WeatherApi(self.api_key)
     result = client.search_date_range(self.start_date, self.end_date, "")
     self.assertEqual(result['weather_observations'][0]['error'],
                      "you must supply a location query")
Beispiel #2
0
 def test_invalid_key(self):
     client = WeatherApi("test")
     result = client.search_date_range(self.start_date, self.end_date,
                                       self.zip_code)
     self.assertEqual(result['weather_observations'][0]['error'],
                      "this key does not exist")
Beispiel #3
0
 def test_search_date_range(self):
     client = WeatherApi(self.api_key)
     print(
         client.search_date_range(self.start_date, self.end_date,
                                  self.zip_code))
Beispiel #4
0
 def test_invalid_param(self):
     client = WeatherApi(self.api_key)
     result = client.search_date_range(self.start_date, self.end_date, "")
     self.assertEqual(result['weather_observations'][0]['error'], "you must supply a location query")
Beispiel #5
0
 def test_invalid_key(self):
     client = WeatherApi("test")
     result = client.search_date_range(self.start_date, self.end_date, self.zip_code)
     self.assertEqual(result['weather_observations'][0]['error'], "this key does not exist")
Beispiel #6
0
 def test_search_date_range(self):
     client = WeatherApi(self.api_key)
     print(client.search_date_range(self.start_date, self.end_date, self.zip_code))