mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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:
parent
a78e389d9b
commit
812bd4af65
@ -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"])
|
||||
|
||||
|
@ -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"])
|
||||
|
@ -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"])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user