Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVP implementation of Backup sync agents #126122

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions tests/components/backup/snapshots/test_websocket.ambr
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# serializer version: 1
# name: test_agents_download[with_hassio]
_Call(
tuple(
),
dict({
'id': 'abc123',
'path': PosixPath('/workspaces/core/tests/testing_config/backup/abc123.tar'),
}),
)
dict({
'id': 1,
'result': None,
'success': True,
'type': 'result',
})
# ---
# name: test_agents_download[without_hassio]
_Call(
tuple(
),
dict({
'id': 'abc123',
'path': PosixPath('/workspaces/core/tests/testing_config/backup/abc123.tar'),
}),
)
dict({
'id': 1,
'result': None,
'success': True,
'type': 'result',
})
# ---
# name: test_agents_download_exception
dict({
Expand Down
8 changes: 6 additions & 2 deletions tests/components/backup/test_websocket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for the Backup integration."""

from pathlib import Path
from unittest.mock import AsyncMock, patch

import pytest
Expand Down Expand Up @@ -313,8 +314,11 @@ async def test_agents_download(
}
)
with patch.object(BackupSyncAgentTest, "async_download_backup") as download_mock:
assert await client.receive_json()
assert snapshot == download_mock.call_args
assert snapshot == await client.receive_json()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the expected value, in this case the snapshot, on the right side of the assertion.

assert download_mock.call_args[1] == {
"id": "abc123",
"path": Path(hass.config.path("backup"), "abc123.tar"),
}


async def test_agents_download_exception(
Expand Down
Loading