Commit 32c0031 1 parent 8f2dffb commit 32c0031 Copy full SHA for 32c0031
File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
- import sys
3
-
4
- # TODO: Clean this up once we no longer need to support Python 2
5
- if sys .version_info .major == 3 :
6
- from unittest import mock
7
- else :
8
- import mock
9
2
3
+ from unittest import mock
10
4
from sonic_platform_base .sonic_thermal_control import thermal_manager_base as tmb
11
5
from sonic_platform_base .sonic_thermal_control import thermal_info_base
12
6
from sonic_platform_base .sonic_thermal_control import thermal_action_base
@@ -78,7 +72,7 @@ def test_run_policy(self):
78
72
MockThermalCondition2 .is_match = mock .MagicMock (return_value = True )
79
73
MockThermalAction1 .execute = mock .MagicMock ()
80
74
MockThermalAction2 .execute = mock .MagicMock ()
81
-
75
+
82
76
chassis = MockChassis ()
83
77
tmb .ThermalManagerBase .run_policy (chassis )
84
78
assert MockThermalInfo .collect .call_count == 1
@@ -95,7 +89,7 @@ def test_run_policy(self):
95
89
assert MockThermalInfo .collect .call_count == 0
96
90
assert MockThermalCondition1 .is_match .call_count == 0
97
91
assert MockThermalCondition2 .is_match .call_count == 0
98
-
92
+
99
93
tmb .ThermalManagerBase ._collect_thermal_information = mock .MagicMock ()
100
94
tmb .ThermalManagerBase .run_policy (chassis )
101
95
assert MockThermalCondition1 .is_match .call_count == 0
You can’t perform that action at this time.
0 commit comments