Working on igd

This commit is contained in:
Steven Looman committed 2018-09-01 21:20:15 +02:00
1 parent 50f63ed4c5
commit 8bec4a55d1
10 files changed
+206 -231

No files matched your search

+3
View File
@@ -10,6 +10,9 @@ async def test_flow_none_discovered(hass):
"""Test no device discovered flow."""
flow = igd_config_flow.IgdFlowHandler()
flow.hass = hass
hass.data[igd.DOMAIN] = {
'discovered': {}
}
result = await flow.async_step_user()
assert result['type'] == 'abort'
+2 -2
View File
@@ -93,7 +93,7 @@ async def test_async_setup_entry_default(hass):
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async_block_till_done()
assert hass.data[igd.DOMAIN]['devices'][udn] is None
assert udn not in hass.data[igd.DOMAIN]['devices']
assert len(mock_igd_device.async_add_port_mapping.mock_calls) == 0
assert len(mock_igd_device.async_delete_port_mapping.mock_calls) == 0
@@ -128,6 +128,6 @@ async def test_async_setup_entry_port_forward(hass):
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async_block_till_done()
assert hass.data[igd.DOMAIN]['devices'][udn] is None
assert udn not in hass.data[igd.DOMAIN]['devices']
assert len(mock_igd_device.async_add_port_mapping.mock_calls) > 0
assert len(mock_igd_device.async_delete_port_mapping.mock_calls) > 0