Skip to content

Commit

Permalink
Prevent tplink from opening sockets in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 4, 2021
1 parent 7235960 commit 5388af3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/components/tplink/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ def device_reg_fixture(hass):
def entity_reg_fixture(hass):
"""Return an empty, loaded, registry."""
return mock_registry(hass)


@pytest.fixture(autouse=True)
def tplink_mock_get_source_ip(mock_get_source_ip):
"""Mock network util's async_get_source_ip."""
2 changes: 1 addition & 1 deletion tests/components/tplink/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def test_configuring_tplink_causes_discovery(hass):
await async_setup_component(hass, tplink.DOMAIN, {tplink.DOMAIN: {}})
await hass.async_block_till_done()

assert len(discover.mock_calls) == 1
assert discover.mock_calls


async def test_config_entry_reload(hass):
Expand Down

0 comments on commit 5388af3

Please sign in to comment.