feat(schedule): add matchtv schedule

This commit is contained in:
2024-08-12 01:19:14 +03:00
parent 6db33ca669
commit bf51ddabc0
17 changed files with 5721 additions and 8 deletions

24
tests/test_matchtv_api.py Normal file
View File

@@ -0,0 +1,24 @@
import datetime
import pytest
from gallery.painting.matchtv.api import MatchTvApi
from gallery.painting.matchtv.mock import MATCHTV_MOCK_DATA
@pytest.fixture(name="matchtv_api", scope="module")
def matchtv_api_fixture() -> MatchTvApi:
api = MatchTvApi()
async def _request(endpoint: str) -> str:
return MATCHTV_MOCK_DATA.get_html(endpoint.split("/")[1])
api._request = _request
return api
async def test_channel(matchtv_api: MatchTvApi):
result = await matchtv_api.get_channel_schedule("matchtv", datetime.date.today())
assert result is not None
assert len(result.items) > 0
print(">>", "\n".join(map(str, result.items)))