J. Nick Koston 2024-04-01 15:34:54 -10:00 committed by GitHub
parent d2e4f5f36e
commit ce9d4c8683
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,13 +453,13 @@ async def test_stop_discovery_called_on_stop(
"""Test pychromecast.stop_discovery called on shutdown."""
# start_discovery should be called with empty config
await async_setup_cast(hass, {})
await hass.async_block_till_done()
await hass.async_block_till_done(wait_background_tasks=True)
assert castbrowser_mock.return_value.start_discovery.call_count == 1
# stop discovery should be called on shutdown
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async_block_till_done()
await hass.async_block_till_done()
await hass.async_block_till_done(wait_background_tasks=True)
await hass.async_block_till_done(wait_background_tasks=True)
assert castbrowser_mock.return_value.stop_discovery.call_count == 1