mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-07-03 03:45:45 +01:00
f8880a72be
* Rename addon/addons to app/apps in filenames and imports Continues the addon→app terminology migration (#6786). Renames all source files, test files, fixture files, and directories that contained 'addon'/'addons' in their names, and updates all imports accordingly. Resolution check files in supervisor/resolution/checks/ that were renamed override the slug property to preserve the existing API contract (slugs are exposed via the resolution info API and used to run checks by name). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Rename add-on.json fixture --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Test fixup app disable boot."""
|
|
|
|
from supervisor.apps.app import App
|
|
from supervisor.const import AppBoot
|
|
from supervisor.coresys import CoreSys
|
|
from supervisor.resolution.const import SuggestionType
|
|
from supervisor.resolution.fixups.app_disable_boot import FixupAppDisableBoot
|
|
|
|
from tests.apps.test_manager import BOOT_FAIL_ISSUE
|
|
|
|
|
|
async def test_fixup(coresys: CoreSys, install_app_ssh: App):
|
|
"""Test fixup disables boot."""
|
|
install_app_ssh.boot = AppBoot.AUTO
|
|
app_disable_boot = FixupAppDisableBoot(coresys)
|
|
assert app_disable_boot.auto is False
|
|
|
|
coresys.resolution.add_issue(
|
|
BOOT_FAIL_ISSUE,
|
|
suggestions=[SuggestionType.DISABLE_BOOT],
|
|
)
|
|
await app_disable_boot()
|
|
|
|
assert install_app_ssh.boot == AppBoot.MANUAL
|
|
assert not coresys.resolution.issues
|
|
assert not coresys.resolution.suggestions
|
|
|
|
|
|
async def test_fixup_no_app(coresys: CoreSys):
|
|
"""Test fixup dismisses if app is missing."""
|
|
app_disable_boot = FixupAppDisableBoot(coresys)
|
|
|
|
coresys.resolution.add_issue(
|
|
BOOT_FAIL_ISSUE,
|
|
suggestions=[SuggestionType.DISABLE_BOOT],
|
|
)
|
|
await app_disable_boot()
|
|
|
|
assert not coresys.resolution.issues
|
|
assert not coresys.resolution.suggestions
|