From 7c8003db45ca118b3f4113f406b356b17653c663 Mon Sep 17 00:00:00 2001 From: sujinmkang Date: Tue, 16 Aug 2022 18:29:43 -0700 Subject: [PATCH] fix the reboot-cause regix for test --- tests/determine-reboot-cause_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/determine-reboot-cause_test.py b/tests/determine-reboot-cause_test.py index 743823dc5e26..e976469c8bde 100644 --- a/tests/determine-reboot-cause_test.py +++ b/tests/determine-reboot-cause_test.py @@ -128,24 +128,24 @@ def test_determine_reboot_cause_hardware(self): def test_determine_reboot_cause_software(self): with mock.patch("determine_reboot_cause.find_proc_cmdline_reboot_cause", return_value="Unknown"): - with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value="Unknown"): - with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value="Unknown"): previous_reboot_cause, additional_info = determine_reboot_cause.determine_reboot_cause() assert previous_reboot_cause == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER assert additional_info == "N/A" def test_determine_reboot_cause_cmdline(self): with mock.patch("determine_reboot_cause.find_proc_cmdline_reboot_cause", return_value=EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE): - with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value="Unknown"): - with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value="Unknown"): previous_reboot_cause, additional_info = determine_reboot_cause.determine_reboot_cause() assert previous_reboot_cause == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER assert additional_info == "N/A" def test_determine_reboot_cause_cmdline_hardware(self): with mock.patch("determine_reboot_cause.find_proc_cmdline_reboot_cause", return_value=EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE): - with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value=REBOOT_CAUSE_WATCHDOG): - with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_software_reboot_cause", return_value=EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER): + with mock.patch("determine_reboot_cause.find_hardware_reboot_cause", return_value=REBOOT_CAUSE_WATCHDOG): previous_reboot_cause, additional_info = determine_reboot_cause.determine_reboot_cause() assert previous_reboot_cause == REBOOT_CAUSE_WATCHDOG assert additional_info == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER