Skip to content

Commit 04e6048

Browse files
authored
Update test_ccmis.py
Fixing the test code failure case.
1 parent 5644385 commit 04e6048

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/sonic_xcvr/test_ccmis.py

+4
Original file line numberDiff line numberDiff line change
@@ -631,19 +631,23 @@ def test_get_transceiver_pm(self, mock_response, expected):
631631
(1, 1),
632632
])
633633
def test_freeze_vdm_stats(self, mock_response, expected):
634+
original_api = self.api.util_status_check_with_retry
634635
self.api.util_status_check_with_retry = MagicMock()
635636
self.api.util_status_check_with_retry.return_value = mock_response
636637
result = self.api.freeze_vdm_stats()
638+
self.api.util_status_check_with_retry = original_api
637639
assert result == expected
638640

639641
@pytest.mark.parametrize("mock_response, expected", [
640642
(0, 0),
641643
(1, 1),
642644
])
643645
def test_unfreeze_vdm_stats(self, mock_response, expected):
646+
original_api = self.api.util_status_check_with_retry
644647
self.api.util_status_check_with_retry = MagicMock()
645648
self.api.util_status_check_with_retry.return_value = mock_response
646649
result = self.api.unfreeze_vdm_stats()
650+
self.api.util_status_check_with_retry = original_api
647651
assert result == expected
648652

649653
@pytest.mark.parametrize("input_param, mock_response, expected",[

0 commit comments

Comments
 (0)