This commit is contained in:
2024-07-24 20:31:43 +03:00
commit 234a2b7b0e
20 changed files with 4363 additions and 0 deletions

0
tests/__init__.py Normal file
View File

22
tests/test_api.py Normal file
View File

@@ -0,0 +1,22 @@
from pathlib import Path
import pytest
from gismeteo.api import GismeteoApi
@pytest.fixture(name="gismeteo_api", scope="module")
def gismeteo_api_fixture() -> GismeteoApi:
api = GismeteoApi()
async def _request(endpoint: str) -> str:
target = endpoint.split("/")[-1]
return (Path(__file__).parent / f"{target}.html").read_text()
api._request = _request
return api
async def test_api(gismeteo_api: GismeteoApi):
result = await gismeteo_api.tomorrow("zmiyevka")
assert len(result) == 8

374
tests/tomorrow.html Normal file

File diff suppressed because one or more lines are too long