init
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
22
tests/test_api.py
Normal file
22
tests/test_api.py
Normal 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
374
tests/tomorrow.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user