feat(rp5): add rp5 api

This commit is contained in:
2026-09-03 19:47:42 +03:00
parent d6487facf4
commit 7c2436fb57
14 changed files with 1278 additions and 13 deletions
+27
View File
@@ -0,0 +1,27 @@
import datetime
import pytest
from gallery.painting.rp5.api import RP5WeatherApi
from tests.common.mock import create_mock_api
from tests.data.rp5 import RP5_MOCK_SOURCE
@pytest.fixture(name="rp5_api", scope="module")
def rp5_api_fixture() -> RP5WeatherApi:
return create_mock_api(RP5WeatherApi, RP5_MOCK_SOURCE)
async def test_search(rp5_api: RP5WeatherApi):
result = await rp5_api.find_locations("test")
assert len(result) == 3
async def test_day(rp5_api: RP5WeatherApi):
result = await rp5_api.get_day("test", datetime.date(2026, 9, 2))
assert len(result.values) == 4
async def test_days(rp5_api: RP5WeatherApi):
result = await rp5_api.get_days("test", 10)
assert len(result.values) == 7