feat(rp5): add rp5 api
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user