Bump cloud to 0.47.1 (#55312)
* Bump cloud to 0.47.0 * Bump reqs * Bump to 0.47.1 * Do not load hass_nabucasa during http startup * fix some tests * Fix test Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
This commit is contained in:
parent
c68e87c40e
commit
27e29b714c
14 changed files with 66 additions and 31 deletions
|
@ -31,6 +31,8 @@ async def test_google_update_report_state(mock_conf, hass, cloud_prefs):
|
|||
await mock_conf.async_initialize()
|
||||
await mock_conf.async_connect_agent_user("mock-user-id")
|
||||
|
||||
mock_conf._cloud.subscription_expired = False
|
||||
|
||||
with patch.object(mock_conf, "async_sync_entities") as mock_sync, patch(
|
||||
"homeassistant.components.google_assistant.report_state.async_enable_report_state"
|
||||
) as mock_report_state:
|
||||
|
@ -41,6 +43,25 @@ async def test_google_update_report_state(mock_conf, hass, cloud_prefs):
|
|||
assert len(mock_report_state.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_google_update_report_state_subscription_expired(
|
||||
mock_conf, hass, cloud_prefs
|
||||
):
|
||||
"""Test Google config not reporting state when subscription has expired."""
|
||||
await mock_conf.async_initialize()
|
||||
await mock_conf.async_connect_agent_user("mock-user-id")
|
||||
|
||||
assert mock_conf._cloud.subscription_expired
|
||||
|
||||
with patch.object(mock_conf, "async_sync_entities") as mock_sync, patch(
|
||||
"homeassistant.components.google_assistant.report_state.async_enable_report_state"
|
||||
) as mock_report_state:
|
||||
await cloud_prefs.async_update(google_report_state=True)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(mock_sync.mock_calls) == 0
|
||||
assert len(mock_report_state.mock_calls) == 0
|
||||
|
||||
|
||||
async def test_sync_entities(mock_conf, hass, cloud_prefs):
|
||||
"""Test sync devices."""
|
||||
await mock_conf.async_initialize()
|
||||
|
@ -172,6 +193,7 @@ async def test_sync_google_when_started(hass, mock_cloud_login, cloud_prefs):
|
|||
with patch.object(config, "async_sync_entities_all") as mock_sync:
|
||||
await config.async_initialize()
|
||||
await config.async_connect_agent_user("mock-user-id")
|
||||
await hass.async_block_till_done()
|
||||
assert len(mock_sync.mock_calls) == 1
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue