From d9824995b27055cbef411d91f91d2975b7e5b5a9 Mon Sep 17 00:00:00 2001 From: Ramesh Raghupathy Date: Tue, 19 Nov 2024 07:11:03 -0800 Subject: [PATCH] Working on coverage --- sonic-chassisd/tests/test_chassisd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sonic-chassisd/tests/test_chassisd.py b/sonic-chassisd/tests/test_chassisd.py index 57930712b..37510e220 100644 --- a/sonic-chassisd/tests/test_chassisd.py +++ b/sonic-chassisd/tests/test_chassisd.py @@ -133,8 +133,10 @@ def test_smartswitch_moduleupdater_status_transitions(): # Create the updater module_updater = SmartSwitchModuleUpdater(SYSLOG_IDENTIFIER, chassis) - # Mock methods that interact with the filesystem - with patch.object(module_updater, 'persist_dpu_reboot_time') as mock_persist_reboot_time, \ + # Mock dependent methods + with patch.object(module_updater, 'retrieve_dpu_reboot_time', return_value="2024-11-19T00:00:00") \ + as mock_retrieve_reboot_time, \ + patch.object(module_updater, '_is_first_boot', return_value=False) as mock_is_first_boot, \ patch.object(module_updater, 'persist_dpu_reboot_cause') as mock_persist_reboot_cause, \ patch.object(module_updater, 'update_dpu_reboot_cause_to_db') as mock_update_reboot_db: