mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-02 00:07:16 +01:00
Fix pytests
This commit is contained in:
@@ -271,6 +271,7 @@ async def test_datadisk_migrate_between_external_renames(
|
||||
all_dbus_services["os_agent"].emit_properties_changed({"Version": "1.5.0"})
|
||||
await all_dbus_services["os_agent"].ping()
|
||||
|
||||
await coresys.core.set_state(CoreState.RUNNING)
|
||||
await coresys.os.datadisk.migrate_disk("Generic-Flash-Disk-61BCDDB6")
|
||||
|
||||
assert datadisk_service.MarkDataMove.calls == [()]
|
||||
|
||||
@@ -5,6 +5,7 @@ from dataclasses import dataclass, replace
|
||||
from dbus_fast import DBusError, ErrorType, Variant
|
||||
import pytest
|
||||
|
||||
from supervisor.const import CoreState
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.resolution.const import ContextType, IssueType, SuggestionType
|
||||
from supervisor.resolution.data import Issue, Suggestion
|
||||
@@ -98,6 +99,7 @@ async def test_fixup(
|
||||
["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"],
|
||||
]
|
||||
|
||||
await coresys.core.set_state(CoreState.RUNNING)
|
||||
await system_adopt_data_disk()
|
||||
|
||||
assert mmcblk1p3_filesystem_service.SetLabel.calls == [
|
||||
@@ -176,6 +178,7 @@ async def test_fixup_reboot_failed(
|
||||
["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"],
|
||||
]
|
||||
|
||||
await coresys.core.set_state(CoreState.RUNNING)
|
||||
await system_adopt_data_disk()
|
||||
|
||||
assert mmcblk1p3_filesystem_service.SetLabel.calls == [
|
||||
@@ -228,6 +231,7 @@ async def test_fixup_disabled_data_disk(
|
||||
["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"],
|
||||
]
|
||||
|
||||
await coresys.core.set_state(CoreState.RUNNING)
|
||||
await system_adopt_data_disk()
|
||||
|
||||
assert mmcblk1p3_filesystem_service.SetLabel.calls == [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Test fixup system reboot."""
|
||||
|
||||
from supervisor.const import CoreState
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.resolution.const import ContextType, IssueType, SuggestionType
|
||||
from supervisor.resolution.data import Issue, Suggestion
|
||||
@@ -25,6 +26,7 @@ async def test_fixup(
|
||||
)
|
||||
coresys.resolution.add_issue(Issue(IssueType.REBOOT_REQUIRED, ContextType.SYSTEM))
|
||||
|
||||
await coresys.core.set_state(CoreState.RUNNING)
|
||||
await system_execute_reboot()
|
||||
|
||||
assert logind_service.Reboot.calls == [(False,)]
|
||||
|
||||
Reference in New Issue
Block a user