Skip to content

Commit

Permalink
Mock RestartWaiter
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak committed Nov 12, 2024
1 parent e415a82 commit 3b1bf7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/system-health/tests/test_system_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .mock_connector import MockConnector

swsscommon.SonicV2Connector = MockConnector
swsscommon.RestartWaiter = MagicMock()

test_path = os.path.dirname(os.path.abspath(__file__))
telemetry_path = os.path.join(test_path, 'telemetry')
Expand All @@ -48,7 +49,7 @@
snmp-subagent EXITED Oct 19 01:53 AM
"""
device_info.get_platform = MagicMock(return_value='unittest')

device_runtime_metadata = {"DEVICE_RUNTIME_METADATA": {"ETHERNET_PORTS_PRESENT":True}}

def no_op(*args, **kwargs):
Expand Down Expand Up @@ -843,7 +844,7 @@ def test_publish_system_status_allowed_status():
sysmon = Sysmonitor()
sysmon.publish_system_status('UP')
sysmon.publish_system_status('DOWN')

expected_calls = [
(("UP",), {}),
(("DOWN",), {})
Expand All @@ -856,7 +857,7 @@ def test_publish_system_status():
sysmon = Sysmonitor()
sysmon.publish_system_status('UP')
result = swsscommon.SonicV2Connector.get(MockConnector, 0, "SYSTEM_READY|SYSTEM_STATE", 'Status')
assert result == "UP"
assert result == "UP"

@patch('health_checker.sysmonitor.Sysmonitor.get_all_system_status', test_get_all_system_status_ok())
@patch('health_checker.sysmonitor.Sysmonitor.publish_system_status', test_publish_system_status())
Expand Down

0 comments on commit 3b1bf7d

Please sign in to comment.