mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 20:26:29 +00:00
Add test for unsupported evalation
This commit is contained in:
parent
42069a358e
commit
3ae4744dd0
44
tests/resolution/evaluation/test_system_architecture.py
Normal file
44
tests/resolution/evaluation/test_system_architecture.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
"""Test evaluation supported system architectures."""
|
||||||
|
|
||||||
|
from unittest.mock import PropertyMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from supervisor.const import CoreState
|
||||||
|
from supervisor.coresys import CoreSys
|
||||||
|
from supervisor.resolution.evaluations.system_architecture import (
|
||||||
|
EvaluateSystemArchitecture,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("arch", ["i386", "armhf"])
|
||||||
|
async def test_evaluation_unsupported_architectures(
|
||||||
|
coresys: CoreSys,
|
||||||
|
arch: str,
|
||||||
|
):
|
||||||
|
"""Test evaluation of unsupported system architectures."""
|
||||||
|
system_architecture = EvaluateSystemArchitecture(coresys)
|
||||||
|
coresys.core.state = CoreState.INITIALIZE
|
||||||
|
|
||||||
|
with patch.object(
|
||||||
|
type(coresys.supervisor), "arch", PropertyMock(return_value=arch)
|
||||||
|
):
|
||||||
|
await system_architecture()
|
||||||
|
assert system_architecture.reason in coresys.resolution.unsupported
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("arch", ["amd64", "aarch64", "armv7"])
|
||||||
|
async def test_evaluation_supported_architectures(
|
||||||
|
coresys: CoreSys,
|
||||||
|
arch: str,
|
||||||
|
):
|
||||||
|
"""Test evaluation of supported system architectures."""
|
||||||
|
system_architecture = EvaluateSystemArchitecture(coresys)
|
||||||
|
coresys.core.state = CoreState.INITIALIZE
|
||||||
|
|
||||||
|
with patch.object(
|
||||||
|
type(coresys.supervisor), "arch", PropertyMock(return_value=arch)
|
||||||
|
):
|
||||||
|
await system_architecture()
|
||||||
|
assert system_architecture.reason not in coresys.resolution.unsupported
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user