1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Fix returned value from backup/info WS command (#67439)

This commit is contained in:
Joakim Sørensen
2022-03-01 21:37:51 +01:00
committed by GitHub
parent 94130a6060
commit e58ce7ab6e
3 changed files with 11 additions and 5 deletions

View File

@@ -20,12 +20,17 @@ async def test_info(
client = await hass_ws_client(hass)
await hass.async_block_till_done()
await client.send_json({"id": 1, "type": "backup/info"})
msg = await client.receive_json()
with patch(
"homeassistant.components.backup.websocket.BackupManager.get_backups",
return_value={TEST_BACKUP.slug: TEST_BACKUP},
):
await client.send_json({"id": 1, "type": "backup/info"})
msg = await client.receive_json()
assert msg["id"] == 1
assert msg["success"]
assert msg["result"] == {"backing_up": False, "backups": []}
assert msg["result"] == {"backing_up": False, "backups": [TEST_BACKUP.as_dict()]}
async def test_remove(