Skip to content

Commit

Permalink
Make new tests async
Browse files Browse the repository at this point in the history
  • Loading branch information
jdejaegh committed Jun 1, 2024
1 parent f651968 commit d354199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_api_data(fixture: str) -> dict:
return json.loads(load_fixture(fixture))


async def patched(url: str, params: dict | None = None) -> bytes:
async def patched(url: str, _params: dict | None = None) -> bytes:
if "cdn.knmi.nl" in url:
file_name = "tests/fixtures/clouds_nl.png"
elif "app.meteo.be/services/appv4/?s=getIncaImage" in url:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ async def test_hourly_forecast() -> None:


@freeze_time(datetime.fromisoformat('2024-05-31T01:50:00+02:00'))
def test_hourly_forecast_bis() -> None:
async def test_hourly_forecast_bis() -> None:
api_data = get_api_data("no-midnight-bug-31-05-2024T01-55.json").get('for', {}).get('hourly')
result = IrmKmiCoordinator.hourly_list_to_forecast(api_data)
result = await IrmKmiCoordinator.hourly_list_to_forecast(api_data)

assert isinstance(result, list)

Expand All @@ -158,10 +158,10 @@ def test_hourly_forecast_bis() -> None:


@freeze_time(datetime.fromisoformat('2024-05-31T00:10:00+02:00'))
def test_hourly_forecast_midnight_bug() -> None:
async def test_hourly_forecast_midnight_bug() -> None:
# Related to https://github.com/jdejaegh/irm-kmi-ha/issues/38
api_data = get_api_data("midnight-bug-31-05-2024T00-13.json").get('for', {}).get('hourly')
result = IrmKmiCoordinator.hourly_list_to_forecast(api_data)
result = await IrmKmiCoordinator.hourly_list_to_forecast(api_data)

assert isinstance(result, list)

Expand Down

0 comments on commit d354199

Please sign in to comment.