More fixtures
This commit is contained in:
parent
9e95bd58a6
commit
30f079b626
1 changed files with 9 additions and 2 deletions
|
@ -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", []
|
||||||
):
|
):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue