Skip to content

Commit c6ed502

Browse files
authored
Rename apis
1 parent 9aa9ca5 commit c6ed502

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sonic-xcvrd/tests/test_xcvrd.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,12 +1400,12 @@ def test_CmisManagerTask_task_run_stop(self, mock_chassis):
14001400
cmis_manager.join()
14011401
assert not cmis_manager.is_alive()
14021402

1403-
def test_CmisManagerTask_reset_app_code_and_reinit_all_lanes(self):
1403+
def test_CmisManagerTask_decommission_all_datapaths(self):
14041404
mock_xcvr_api = MagicMock()
14051405
port_mapping = PortMapping()
14061406
stop_event = threading.Event()
14071407
task = CmisManagerTask(DEFAULT_NAMESPACE, port_mapping, stop_event)
1408-
task.reset_app_code_and_reinit_all_lanes(mock_xcvr_api)
1408+
assert task.decommission_all_datapaths(mock_xcvr_api) == True
14091409

14101410
assert mock_xcvr_api.set_application.call_count == 1
14111411
assert mock_xcvr_api.set_datapath_deinit.call_count == 1
@@ -1415,15 +1415,16 @@ def test_CmisManagerTask_reset_app_code_and_reinit_all_lanes(self):
14151415
(2, {0 : 1, 1 : 1, 2 : 1, 3 : 1, 4 : 2, 5 : 2, 6 : 2, 7 : 2}),
14161416
(0, {0 : 1, 1 : 1, 2 : 1, 3 : 1},)
14171417
])
1418-
def test_CmisManagerTask_is_cmis_app_code_reset_required(self, app_new, lane_appl_code):
1418+
def test_CmisManagerTask_is_appl_reconfigure_required(self, app_new, lane_appl_code):
14191419
mock_xcvr_api = MagicMock()
14201420
def get_application(lane):
14211421
return lane_appl_code.get(lane, 0)
14221422
mock_xcvr_api.get_application = MagicMock(side_effect=get_application)
14231423
port_mapping = PortMapping()
14241424
stop_event = threading.Event()
14251425
task = CmisManagerTask(DEFAULT_NAMESPACE, port_mapping, stop_event)
1426-
task.is_cmis_app_code_reset_required(mock_xcvr_api, app_new)
1426+
mock_xcvr_api.decommission_all_datapaths = MagicMock(return_value=True)
1427+
assert task.is_appl_reconfigure_required(mock_xcvr_api, app_new) == True
14271428

14281429
DEFAULT_DP_STATE = {
14291430
'DP1State': 'DataPathActivated',

0 commit comments

Comments
 (0)