Skip to content

Commit 8720561

Browse files
committed
Fix and add hardware reboot cause determination tests
1 parent 0dcc7fe commit 8720561

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/determine-reboot-cause_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ def test_find_proc_cmdline_reboot_cause(self):
109109
def test_find_hardware_reboot_cause(self):
110110
with mock.patch("determine_reboot_cause.get_reboot_cause_from_platform", return_value=("Powerloss", None)):
111111
result = determine_reboot_cause.find_hardware_reboot_cause()
112-
assert result == "Powerloss (None)"
112+
assert result == "Powerloss"
113+
114+
def test_find_hardware_reboot_cause_with_minor(self):
115+
with mock.patch("determine_reboot_cause.get_reboot_cause_from_platform", return_value=("Powerloss", "under-voltage")):
116+
result = determine_reboot_cause.find_hardware_reboot_cause()
117+
assert result == "Powerloss (under-voltage)"
113118

114119
def test_get_reboot_cause_dict_watchdog(self):
115120
reboot_cause_dict = determine_reboot_cause.get_reboot_cause_dict(REBOOT_CAUSE_WATCHDOG, "", GEN_TIME_WATCHDOG)

0 commit comments

Comments
 (0)