Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flexmeasures_weather/cli/tests/test_get_forecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ..commands import collect_weather_data
from ...utils import weather
from .utils import mock_owm_response
from .utils import mock_api_response


"""
Expand All @@ -24,7 +24,7 @@ def test_get_weather_forecasts_to_db(
weather_station = wind_sensor.generic_asset

monkeypatch.setitem(app.config, "WEATHERAPI_KEY", "dummy")
monkeypatch.setattr(weather, "call_openweatherapi", mock_owm_response)
monkeypatch.setattr(weather, "call_api", mock_api_response)

runner = app.test_cli_runner()
result = runner.invoke(
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_get_weather_forecasts_no_close_sensors(
weather_station = add_weather_sensors_fresh_db["wind"].generic_asset

monkeypatch.setitem(app.config, "WEATHERAPI_KEY", "dummy")
monkeypatch.setattr(weather, "call_openweatherapi", mock_owm_response)
monkeypatch.setattr(weather, "call_api", mock_api_response)

runner = app.test_cli_runner()
with caplog.at_level(logging.WARNING):
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures_weather/cli/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def cli_params_from_dict(d) -> List[str]:
return cli_params


def mock_owm_response(api_key, location):
def mock_api_response(api_key, location):
mock_date = datetime.now()
mock_date_tz_aware = as_server_time(
datetime.fromtimestamp(mock_date.timestamp(), tz=get_timezone())
Expand Down