28 lines
730 B
Python
28 lines
730 B
Python
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, 11))
|
|
assert len(result.values) == 4
|
|
|
|
|
|
async def test_days(rp5_api: RP5WeatherApi):
|
|
result = await rp5_api.get_days("test", 10)
|
|
assert len(result.values) == 8
|