@@ -119,33 +119,33 @@ def test_get_reboot_cause_dict_kernel_panic(self):
119
119
assert reboot_cause_dict == EXPECTED_KERNEL_PANIC_REBOOT_CAUSE_DICT
120
120
121
121
def test_determine_reboot_cause_hardware (self ):
122
- with mock .patch ("determine_reboot_cause.find_proc_cmdline_reboot_cause" , return_value = "Unknown" ):
123
- with mock .patch ("determine_reboot_cause.find_software_reboot_cause" , return_value = "Power Cycle" ):
124
- with mock .patch ("determine_reboot_cause.find_hardware_reboot_cause" , return_value = "Unknown" ):
122
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_proc_cmdline_reboot_cause" , return_value = "Unknown" ):
123
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_software_reboot_cause" , return_value = "Power Cycle" ):
124
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_hardware_reboot_cause" , return_value = "Unknown" ):
125
125
previous_reboot_cause , additional_info = determine_reboot_cause .determine_reboot_cause ()
126
126
assert previous_reboot_cause == "Power Cycle"
127
127
assert additional_info == "N/A"
128
128
129
129
def test_determine_reboot_cause_software (self ):
130
- with mock .patch ("determine_reboot_cause.find_proc_cmdline_reboot_cause" , return_value = "Unknown" ):
131
- with mock .patch ("determine_reboot_cause.find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
132
- with mock .patch ("determine_reboot_cause.find_hardware_reboot_cause" , return_value = "Unknown" ):
130
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_proc_cmdline_reboot_cause" , return_value = "Unknown" ):
131
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
132
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_hardware_reboot_cause" , return_value = "Unknown" ):
133
133
previous_reboot_cause , additional_info = determine_reboot_cause .determine_reboot_cause ()
134
134
assert previous_reboot_cause == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER
135
135
assert additional_info == "N/A"
136
136
137
137
def test_determine_reboot_cause_cmdline (self ):
138
- with mock .patch ("determine_reboot_cause.find_proc_cmdline_reboot_cause" , return_value = EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE ):
139
- with mock .patch ("determine_reboot_cause.find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
140
- with mock .patch ("determine_reboot_cause.find_hardware_reboot_cause" , return_value = "Unknown" ):
138
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_proc_cmdline_reboot_cause" , return_value = EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE ):
139
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
140
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_hardware_reboot_cause" , return_value = "Unknown" ):
141
141
previous_reboot_cause , additional_info = determine_reboot_cause .determine_reboot_cause ()
142
142
assert previous_reboot_cause == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER
143
143
assert additional_info == "N/A"
144
144
145
145
def test_determine_reboot_cause_cmdline_hardware (self ):
146
- with mock .patch ("determine_reboot_cause.find_proc_cmdline_reboot_cause" , return_value = EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE ):
147
- with mock .patch ("determine_reboot_cause.find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
148
- with mock .patch ("determine_reboot_cause.find_hardware_reboot_cause" , return_value = REBOOT_CAUSE_WATCHDOG ):
146
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_proc_cmdline_reboot_cause" , return_value = EXPECTED_PARSE_WARMFAST_REBOOT_FROM_PROC_CMDLINE ):
147
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_software_reboot_cause" , return_value = EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER ):
148
+ with mock .patch ("determine_reboot_cause.determine_reboot_cause. find_hardware_reboot_cause" , return_value = REBOOT_CAUSE_WATCHDOG ):
149
149
previous_reboot_cause , additional_info = determine_reboot_cause .determine_reboot_cause ()
150
150
assert previous_reboot_cause == REBOOT_CAUSE_WATCHDOG
151
151
assert additional_info == EXPECTED_FIND_SOFTWARE_REBOOT_CAUSE_USER
0 commit comments