Always mock SubscriptionRegistry & DiscoveryResponder for wemo tests (#53967)
* Always mock SubscriptionRegistry & DiscoveryResponder for wemo tests * Use autospec=True for patch
This commit is contained in:
parent
e11ffbcdaf
commit
71b123845c
1 changed files with 9 additions and 2 deletions
|
@ -22,8 +22,8 @@ def pywemo_model_fixture():
|
||||||
return "LightSwitch"
|
return "LightSwitch"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="pywemo_registry")
|
@pytest.fixture(name="pywemo_registry", autouse=True)
|
||||||
def pywemo_registry_fixture():
|
async def async_pywemo_registry_fixture():
|
||||||
"""Fixture for SubscriptionRegistry instances."""
|
"""Fixture for SubscriptionRegistry instances."""
|
||||||
registry = create_autospec(pywemo.SubscriptionRegistry, instance=True)
|
registry = create_autospec(pywemo.SubscriptionRegistry, instance=True)
|
||||||
|
|
||||||
|
@ -40,6 +40,13 @@ def pywemo_registry_fixture():
|
||||||
yield registry
|
yield registry
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="pywemo_discovery_responder", autouse=True)
|
||||||
|
def pywemo_discovery_responder_fixture():
|
||||||
|
"""Fixture for the DiscoveryResponder instance."""
|
||||||
|
with patch("pywemo.ssdp.DiscoveryResponder", autospec=True):
|
||||||
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="pywemo_device")
|
@pytest.fixture(name="pywemo_device")
|
||||||
def pywemo_device_fixture(pywemo_registry, pywemo_model):
|
def pywemo_device_fixture(pywemo_registry, pywemo_model):
|
||||||
"""Fixture for WeMoDevice instances."""
|
"""Fixture for WeMoDevice instances."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue