mirror of
https://github.com/home-assistant/supervisor
synced 2024-08-05 03:49:58 +02:00
692d34a13c
* Handle OSError / Filesystem corruptions * Fix tests
22 lines
696 B
Python
22 lines
696 B
Python
"""Test evaluations."""
|
|
|
|
from unittest.mock import Mock, patch
|
|
|
|
from supervisor.const import CoreState
|
|
from supervisor.coresys import CoreSys
|
|
from supervisor.utils import check_exception_chain
|
|
|
|
|
|
async def test_evaluate_system_error(coresys: CoreSys, capture_exception: Mock):
|
|
"""Test error while evaluating system."""
|
|
coresys.core.state = CoreState.RUNNING
|
|
|
|
with patch(
|
|
"supervisor.resolution.evaluations.source_mods.calc_checksum_path_sourcecode",
|
|
side_effect=RuntimeError,
|
|
):
|
|
await coresys.resolution.evaluate.evaluate_system()
|
|
|
|
capture_exception.assert_called_once()
|
|
assert check_exception_chain(capture_exception.call_args[0][0], RuntimeError)
|