eat(yandexweather): add yandexweather api
This commit is contained in:
@@ -3,20 +3,13 @@ import datetime
|
||||
import pytest
|
||||
|
||||
from gallery.painting.openweather.api import OpenWeatherApi
|
||||
from gallery.painting.openweather.openweather import OpenWeather
|
||||
from tests.common.mock import create_mock_api
|
||||
from tests.data.openweather import OPENWEATHER_MOCK_SOURCE
|
||||
|
||||
|
||||
@pytest.fixture(name="openweather_api", scope="module")
|
||||
def openweather_api_fixture() -> OpenWeatherApi:
|
||||
class MockOpenWeather(OpenWeather):
|
||||
def __init__(self):
|
||||
super().__init__("")
|
||||
self._source = OPENWEATHER_MOCK_SOURCE
|
||||
|
||||
api = OpenWeatherApi()
|
||||
api.SOURCE = MockOpenWeather()
|
||||
return api
|
||||
return create_mock_api(OpenWeatherApi, OPENWEATHER_MOCK_SOURCE)
|
||||
|
||||
|
||||
async def test_search(openweather_api: OpenWeatherApi):
|
||||
|
||||
Reference in New Issue
Block a user