Skip to content

Commit

Permalink
Add full backup options tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdegat01 committed Dec 19, 2024
1 parent fc50dfb commit f6e71b9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,30 @@ async def test_partial_backup_model(
"""Test partial backup model parsing and serializing."""
assert PartialBackupOptions.from_dict(as_dict) == options
assert options.to_dict() == as_dict


@pytest.mark.parametrize(
("options", "as_dict"),
[
(FullBackupOptions(name="Test"), {"name": "Test"}),
(FullBackupOptions(password="test"), {"password": "test"}), # noqa: S106
(FullBackupOptions(compressed=True), {"compressed": True}),
(
FullBackupOptions(homeassistant_exclude_database=True),
{"homeassistant_exclude_database": True},
),
(FullBackupOptions(background=True), {"background": True}),
(
FullBackupOptions(location=[".cloud_backup", "test"]),
{"location": [".cloud_backup", "test"]},
),
(FullBackupOptions(location="test"), {"location": "test"}),
(FullBackupOptions(location=None), {"location": None}),
],
)
async def test_full_backup_model(
options: FullBackupOptions, as_dict: dict[str, Any]
) -> None:
"""Test full backup model parsing and serializing."""
assert FullBackupOptions.from_dict(as_dict) == options
assert options.to_dict() == as_dict

0 comments on commit f6e71b9

Please sign in to comment.