Move metoffice fixture to integration test (#112992)

* Move metoffice fixture to integration test

* Fix

* Update tests/components/metoffice/test_config_flow.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Fix

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Joost Lekkerkerker 2024-03-11 04:27:00 +01:00 committed by GitHub
parent a78e389d9b
commit 812bd4af65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ async def test_form(hass: HomeAssistant, requests_mock: requests_mock.Mocker) ->
hass.config.longitude = TEST_LONGITUDE_WAVERTREE
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
all_sites = json.dumps(mock_json["all_sites"])
requests_mock.get("/public/data/val/wxfcs/all/json/sitelist/", text=all_sites)
@ -64,7 +64,7 @@ async def test_form_already_configured(
hass.config.longitude = TEST_LONGITUDE_WAVERTREE
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
all_sites = json.dumps(mock_json["all_sites"])

View File

@ -31,7 +31,7 @@ async def test_one_sensor_site_running(
) -> None:
"""Test the Met Office sensor platform."""
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
all_sites = json.dumps(mock_json["all_sites"])
wavertree_hourly = json.dumps(mock_json["wavertree_hourly"])
wavertree_daily = json.dumps(mock_json["wavertree_daily"])
@ -80,7 +80,7 @@ async def test_two_sensor_sites_running(
"""Test we handle two sets of sensors running for two different sites."""
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
all_sites = json.dumps(mock_json["all_sites"])
wavertree_hourly = json.dumps(mock_json["wavertree_hourly"])
wavertree_daily = json.dumps(mock_json["wavertree_daily"])

View File

@ -48,7 +48,7 @@ def no_sensor():
async def wavertree_data(requests_mock: requests_mock.Mocker) -> dict[str, _Matcher]:
"""Mock data for the Wavertree location."""
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
all_sites = json.dumps(mock_json["all_sites"])
wavertree_hourly = json.dumps(mock_json["wavertree_hourly"])
wavertree_daily = json.dumps(mock_json["wavertree_daily"])
@ -247,7 +247,7 @@ async def test_two_weather_sites_running(
)
# all metoffice test data encapsulated in here
mock_json = json.loads(load_fixture("metoffice.json"))
mock_json = json.loads(load_fixture("metoffice.json", "metoffice"))
kingslynn_hourly = json.dumps(mock_json["kingslynn_hourly"])
kingslynn_daily = json.dumps(mock_json["kingslynn_daily"])