Files
supervisor/tests/resolution/fixup/test_system_create_full_backup.py
Mike Degatano 0636e49fe2 Enable mypy part 1 (addons and api) (#5759)
* Fix mypy issues in addons

* Fix mypy issues in api

* fix docstring

* Brackets instead of get with default
2025-03-25 15:06:35 -04:00

31 lines
870 B
Python

"""Test create full backup fixup."""
# pylint: disable=import-error,protected-access
from unittest.mock import AsyncMock
from supervisor.coresys import CoreSys
from supervisor.resolution.const import ContextType, SuggestionType
from supervisor.resolution.data import Suggestion
from supervisor.resolution.fixups.system_create_full_backup import (
FixupSystemCreateFullBackup,
)
async def test_fixup(coresys: CoreSys):
"""Test fixup."""
create_full_backup = FixupSystemCreateFullBackup(coresys)
assert not create_full_backup.auto
coresys.resolution.add_suggestion(
Suggestion(SuggestionType.CREATE_FULL_BACKUP, ContextType.SYSTEM)
)
mock_backups = AsyncMock()
coresys.backups.do_backup_full = mock_backups
await create_full_backup()
mock_backups.assert_called()
assert len(coresys.resolution.suggestions) == 0