From 8b20eb122059e856e93341aa3f97bbb7cd130573 Mon Sep 17 00:00:00 2001 From: shmyga Date: Fri, 26 Jun 2026 16:27:36 +0300 Subject: [PATCH] test(openweather): add openweather location seacrh test --- tests/data/openweather/__init__.py | 1 + tests/data/openweather/{locations.json => geo-direct.json} | 0 tests/test_openweather_api.py | 5 +++++ 3 files changed, 6 insertions(+) rename tests/data/openweather/{locations.json => geo-direct.json} (100%) diff --git a/tests/data/openweather/__init__.py b/tests/data/openweather/__init__.py index 748d2dd..ef06b9d 100644 --- a/tests/data/openweather/__init__.py +++ b/tests/data/openweather/__init__.py @@ -6,5 +6,6 @@ OPENWEATHER_MOCK_SOURCE = MockSource( Path(__file__).parent, { "forecast": "forecast.json", + "direct": "geo-direct.json", }, ) diff --git a/tests/data/openweather/locations.json b/tests/data/openweather/geo-direct.json similarity index 100% rename from tests/data/openweather/locations.json rename to tests/data/openweather/geo-direct.json diff --git a/tests/test_openweather_api.py b/tests/test_openweather_api.py index 31ceb21..9041633 100644 --- a/tests/test_openweather_api.py +++ b/tests/test_openweather_api.py @@ -19,6 +19,11 @@ def openweather_api_fixture() -> OpenWeatherApi: return api +async def test_search(openweather_api: OpenWeatherApi): + result = await openweather_api.find_locations("test") + assert len(result) == 5 + + async def test_day(openweather_api: OpenWeatherApi): result = await openweather_api.get_day("52.968498:36.0695", datetime.date(2024, 8, 23)) assert len(result.values) == 8