mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix lingering timer in smartthings tests (#91697)
This commit is contained in:
parent
3d39854ffc
commit
24428d98a1
@ -179,7 +179,7 @@ async def test_scenes_unauthorized_loads_platforms(
|
|||||||
smartthings_mock.subscriptions.return_value = subscriptions
|
smartthings_mock.subscriptions.return_value = subscriptions
|
||||||
|
|
||||||
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
||||||
assert await smartthings.async_setup_entry(hass, config_entry)
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
# Assert platforms loaded
|
# Assert platforms loaded
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert forward_mock.call_count == len(PLATFORMS)
|
assert forward_mock.call_count == len(PLATFORMS)
|
||||||
@ -211,7 +211,7 @@ async def test_config_entry_loads_platforms(
|
|||||||
smartthings_mock.subscriptions.return_value = subscriptions
|
smartthings_mock.subscriptions.return_value = subscriptions
|
||||||
|
|
||||||
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
||||||
assert await smartthings.async_setup_entry(hass, config_entry)
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
# Assert platforms loaded
|
# Assert platforms loaded
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert forward_mock.call_count == len(PLATFORMS)
|
assert forward_mock.call_count == len(PLATFORMS)
|
||||||
@ -243,7 +243,7 @@ async def test_config_entry_loads_unconnected_cloud(
|
|||||||
]
|
]
|
||||||
smartthings_mock.subscriptions.return_value = subscriptions
|
smartthings_mock.subscriptions.return_value = subscriptions
|
||||||
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
with patch.object(hass.config_entries, "async_forward_entry_setup") as forward_mock:
|
||||||
assert await smartthings.async_setup_entry(hass, config_entry)
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert forward_mock.call_count == len(PLATFORMS)
|
assert forward_mock.call_count == len(PLATFORMS)
|
||||||
|
|
||||||
@ -480,6 +480,8 @@ async def test_event_handler_dispatches_updated_devices(
|
|||||||
assert devices[3].status.attributes["lock"].value == "locked"
|
assert devices[3].status.attributes["lock"].value == "locked"
|
||||||
assert devices[3].status.attributes["lock"].data == {"codeId": "1"}
|
assert devices[3].status.attributes["lock"].data == {"codeId": "1"}
|
||||||
|
|
||||||
|
broker.disconnect()
|
||||||
|
|
||||||
|
|
||||||
async def test_event_handler_ignores_other_installed_app(
|
async def test_event_handler_ignores_other_installed_app(
|
||||||
hass: HomeAssistant, config_entry, device_factory, event_request_factory
|
hass: HomeAssistant, config_entry, device_factory, event_request_factory
|
||||||
@ -502,6 +504,8 @@ async def test_event_handler_ignores_other_installed_app(
|
|||||||
|
|
||||||
assert not called
|
assert not called
|
||||||
|
|
||||||
|
broker.disconnect()
|
||||||
|
|
||||||
|
|
||||||
async def test_event_handler_fires_button_events(
|
async def test_event_handler_fires_button_events(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@ -542,3 +546,5 @@ async def test_event_handler_fires_button_events(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert called
|
assert called
|
||||||
|
|
||||||
|
broker.disconnect()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user