refactor: rename project to gallery
This commit is contained in:
@@ -2,8 +2,8 @@ import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from gismeteo.api import GismeteoApi
|
||||
from gismeteo.mock import MOCK_DATA
|
||||
from gallery.painting.gismeteo.api import GismeteoApi
|
||||
from gallery.painting.gismeteo.mock import GISMETEO_MOCK_DATA
|
||||
|
||||
|
||||
@pytest.fixture(name="gismeteo_api", scope="module")
|
||||
@@ -11,17 +11,17 @@ def gismeteo_api_fixture() -> GismeteoApi:
|
||||
api = GismeteoApi()
|
||||
|
||||
async def _request(endpoint: str) -> str:
|
||||
return MOCK_DATA.get_html(endpoint.split("/")[-1])
|
||||
return GISMETEO_MOCK_DATA.get_html(endpoint.split("/")[-1])
|
||||
|
||||
api._request = _request
|
||||
return api
|
||||
|
||||
|
||||
async def test_day(gismeteo_api: GismeteoApi):
|
||||
result = await gismeteo_api.get_day("zmiyevka", datetime.date.today())
|
||||
result = await gismeteo_api.get_day("test", datetime.date.today())
|
||||
assert len(result.values) == 8
|
||||
|
||||
|
||||
async def test_days(gismeteo_api: GismeteoApi):
|
||||
result = await gismeteo_api.get_days("zmiyevka", 10)
|
||||
result = await gismeteo_api.get_days("test", 10)
|
||||
assert len(result.values) == 10
|
||||
|
||||
Reference in New Issue
Block a user