Skip to content

Commit

Permalink
Update test_xcvrd.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AnoopKamath committed May 17, 2024
1 parent 674945f commit b6cbcf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic-xcvrd/tests/test_xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,14 +1879,14 @@ def test_CmisManagerTask_task_worker(self, mock_chassis, mock_get_status_tbl):
task.configure_tx_output_power = MagicMock(return_value=1)
task.configure_laser_frequency = MagicMock(return_value=1)

task.is_appl_reconfigure_required = MagicMock(return_value=False)
# Fail test coverage - Module Inserted state failing to reach DP_DEINIT
task.is_appl_reconfigure_required = MagicMock(return_value=False)
task.task_stopping_event.is_set = MagicMock(side_effect=[False, False, True])
task.task_worker()
assert get_cmis_state_from_state_db('Ethernet0', task.xcvr_table_helper.get_status_tbl(task.port_mapping.get_asic_id_for_logical_port('Ethernet0'))) == CMIS_STATE_INSERTED

task.is_appl_reconfigure_required = MagicMock(return_value=True)
# Case 1: Module Inserted --> DP_DEINIT
task.is_appl_reconfigure_required = MagicMock(return_value=True)
task.task_stopping_event.is_set = MagicMock(side_effect=[False, False, True])
task.task_worker()
assert get_cmis_state_from_state_db('Ethernet0', task.xcvr_table_helper.get_status_tbl(task.port_mapping.get_asic_id_for_logical_port('Ethernet0'))) == CMIS_STATE_DP_DEINIT
Expand Down

0 comments on commit b6cbcf6

Please sign in to comment.