mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 06:05:10 +02:00
More fixtures
This commit is contained in:
@@ -34,11 +34,18 @@ def data_cdc_fixture():
|
|||||||
return json.loads(load_fixture("cdc_data.json", "flunearyou"))
|
return json.loads(load_fixture("cdc_data.json", "flunearyou"))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="cdc_status_by_coordinates")
|
||||||
|
def cdc_status_by_coordinates_fixture(data_cdc):
|
||||||
|
"""Define a patched call to CdcReport.status_by_coordinates."""
|
||||||
|
return data_cdc
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="setup_flunearyou")
|
@pytest.fixture(name="setup_flunearyou")
|
||||||
async def setup_flunearyou_fixture(hass, config, data_cdc):
|
async def setup_flunearyou_fixture(hass, cdc_status_by_coordinates, config, data_cdc):
|
||||||
"""Define a fixture to set up Flu Near You."""
|
"""Define a fixture to set up Flu Near You."""
|
||||||
with patch(
|
with patch(
|
||||||
"pyflunearyou.cdc.CdcReport.status_by_coordinates", side_effect=data_cdc
|
"pyflunearyou.cdc.CdcReport.status_by_coordinates",
|
||||||
|
side_effect=cdc_status_by_coordinates,
|
||||||
), patch("pyflunearyou.user.UserReport.status_by_coordinates"), patch(
|
), patch("pyflunearyou.user.UserReport.status_by_coordinates"), patch(
|
||||||
"homeassistant.components.flunearyou.PLATFORMS", []
|
"homeassistant.components.flunearyou.PLATFORMS", []
|
||||||
):
|
):
|
||||||
|
Reference in New Issue
Block a user