Skip to content

Commit

Permalink
Fix TODO comment (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox authored Dec 13, 2022
1 parent 8f2dffb commit 32c0031
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/thermal_manager_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import os
import sys

# TODO: Clean this up once we no longer need to support Python 2
if sys.version_info.major == 3:
from unittest import mock
else:
import mock

from unittest import mock
from sonic_platform_base.sonic_thermal_control import thermal_manager_base as tmb
from sonic_platform_base.sonic_thermal_control import thermal_info_base
from sonic_platform_base.sonic_thermal_control import thermal_action_base
Expand Down Expand Up @@ -78,7 +72,7 @@ def test_run_policy(self):
MockThermalCondition2.is_match = mock.MagicMock(return_value=True)
MockThermalAction1.execute = mock.MagicMock()
MockThermalAction2.execute = mock.MagicMock()

chassis = MockChassis()
tmb.ThermalManagerBase.run_policy(chassis)
assert MockThermalInfo.collect.call_count == 1
Expand All @@ -95,7 +89,7 @@ def test_run_policy(self):
assert MockThermalInfo.collect.call_count == 0
assert MockThermalCondition1.is_match.call_count == 0
assert MockThermalCondition2.is_match.call_count == 0

tmb.ThermalManagerBase._collect_thermal_information = mock.MagicMock()
tmb.ThermalManagerBase.run_policy(chassis)
assert MockThermalCondition1.is_match.call_count == 0
Expand Down

0 comments on commit 32c0031

Please sign in to comment.