Skip to content

Commit

Permalink
Working on coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshraghupathy committed Nov 14, 2024
1 parent 60fa5a9 commit dacadb5
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions sonic-chassisd/tests/test_chassisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,21 +533,6 @@ def test_smartswitch_module_db_update():
# mock_makedirs.assert_called_once_with("/host/reboot-cause/module/reboot_cause/dpu0/history", exist_ok=True)


def test_module_db_update_offline_transition():
# Set up the SmartSwitchModuleUpdater instance
module_updater = SmartSwitchModuleUpdater(SYSLOG_IDENTIFIER, chassis=MagicMock())
key = "DPU0"
module_info_dict = {CHASSIS_MODULE_INFO_OPERSTATUS_FIELD: str(ModuleBase.MODULE_STATUS_OFFLINE)}

# Mock previous status to simulate the transition
with patch.object(module_updater, "module_info_dict", {key: "online"}), \
patch.object(module_updater, "persist_dpu_reboot_time") as mock_persist_reboot_time, \
patch.object(module_updater, "log_notice") as mock_log_notice:

# Call the method without extra arguments; let it use the mocked data
module_updater.module_db_update()


def test_platform_json_file_exists_and_valid():
"""Test case where the platform JSON file exists with valid data."""
chassis = MockSmartSwitchChassis()
Expand Down

0 comments on commit dacadb5

Please sign in to comment.