24 lines
661 B
Python
24 lines
661 B
Python
import datetime
|
|
|
|
import pytest
|
|
|
|
from gallery.painting.matchtv.api import MatchTVApi
|
|
from tests.common.mock import create_mock_api
|
|
from tests.data.matchtv import MATCHTV_MOCK_SOURCE
|
|
|
|
|
|
@pytest.fixture(name="matchtv_api", scope="module")
|
|
def matchtv_api_fixture() -> MatchTVApi:
|
|
return create_mock_api(MatchTVApi, MATCHTV_MOCK_SOURCE)
|
|
|
|
|
|
async def test_search(matchtv_api: MatchTVApi):
|
|
result = await matchtv_api.find_channels("матч")
|
|
assert len(result) == 6
|
|
|
|
|
|
async def test_channel(matchtv_api: MatchTVApi):
|
|
result = await matchtv_api.get_schedule("test", datetime.date.today())
|
|
assert result is not None
|
|
assert len(result.values) > 0
|