mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 11:39:26 +02:00
Make new tests async
This commit is contained in:
parent
f651968b4d
commit
d354199ace
2 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue