Set up Met during onboarding (#24622)
* Set up Met during onboarding * Lint * Add pyMetNo to test reqs
This commit is contained in:
1 parent
6ea92f86a5
commit
f2962a0d16
12 files changed
+242
-54
No files matched your search
@@ -0,0 +1,24 @@
|
||||
"""Fixtures for Met weather testing."""
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.common import mock_coro
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_weather():
|
||||
"""Mock weather data."""
|
||||
with patch('metno.MetWeatherData') as mock_data:
|
||||
mock_data = mock_data.return_value
|
||||
mock_data.fetching_data.side_effect = lambda: mock_coro(True)
|
||||
mock_data.get_current_weather.return_value = {
|
||||
'condition': 'cloudy',
|
||||
'temperature': 15,
|
||||
'pressure': 100,
|
||||
'humidity': 50,
|
||||
'wind_speed': 10,
|
||||
'wind_bearing': 'NE',
|
||||
}
|
||||
mock_data.get_forecast.return_value = {}
|
||||
yield mock_data
|
||||
Reference in new issue
Block a user