Skip to content

Commit 91fa227

Browse files
feat: weather forecast - add API mocking & improve coverage
1 parent 4eecea1 commit 91fa227

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_weather_forecast.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,12 @@ def test_historical_exception_from_api():
6868
requests.get(HISTORY_URL)
6969
output = get_weather_data(requested_date, "neo")
7070
assert output['Status'] == -1
71+
72+
73+
@responses.activate
74+
def test_forecast_exception_from_api():
75+
requested_date = datetime.datetime.now() + datetime.timedelta(days=3)
76+
with pytest.raises(requests.exceptions.ConnectionError):
77+
requests.get(FORECAST_URL)
78+
output = get_weather_data(requested_date, "neo")
79+
assert output['Status'] == -1

0 commit comments

Comments
 (0)