@@ -1079,14 +1079,13 @@ def test_del_port_sfp_dom_info_from_db(self):
1079
1079
del_port_sfp_dom_info_from_db (logical_port_name , port_mapping , [init_tbl , dom_tbl , dom_threshold_tbl , pm_tbl , firmware_info_tbl ])
1080
1080
assert dom_tbl .get_size () == 0
1081
1081
1082
- @pytest .mark .parametrize ("mock_found, mock_status_dict, expected_cmis_state" , [
1083
- (True , {'cmis_state' : CMIS_STATE_INSERTED }, CMIS_STATE_INSERTED ),
1084
- (False , {}, CMIS_STATE_UNKNOWN ),
1085
- (True , {'other_key' : 'some_value' }, CMIS_STATE_UNKNOWN )
1082
+ @pytest .mark .parametrize ("mock_found, mock_state, expected_cmis_state" , [
1083
+ (True , CMIS_STATE_INSERTED , CMIS_STATE_INSERTED ),
1084
+ (False , None , CMIS_STATE_UNKNOWN )
1086
1085
])
1087
- def test_get_cmis_state_from_state_db (self , mock_found , mock_status_dict , expected_cmis_state ):
1086
+ def test_get_cmis_state_from_state_db (self , mock_found , mock_state , expected_cmis_state ):
1088
1087
status_tbl = MagicMock ()
1089
- status_tbl .get .return_value = (mock_found , mock_status_dict )
1088
+ status_tbl .hget .return_value = (mock_found , mock_state )
1090
1089
assert get_cmis_state_from_state_db ("Ethernet0" , status_tbl ) == expected_cmis_state
1091
1090
1092
1091
@patch ('xcvrd.xcvrd_utilities.port_event_helper.PortMapping.logical_port_name_to_physical_port_list' , MagicMock (return_value = [0 ]))
@@ -2264,7 +2263,7 @@ def test_CmisManagerTask_get_configured_freq(self, mock_table_helper):
2264
2263
stop_event = threading .Event ()
2265
2264
task = CmisManagerTask (DEFAULT_NAMESPACE , port_mapping , stop_event )
2266
2265
cfg_port_tbl = MagicMock ()
2267
- cfg_port_tbl .get = MagicMock (return_value = (True , (( 'laser_freq' , 193100 ),) ))
2266
+ cfg_port_tbl .hget = MagicMock (return_value = (True , 193100 ))
2268
2267
mock_table_helper .get_cfg_port_tbl = MagicMock (return_value = cfg_port_tbl )
2269
2268
task .xcvr_table_helper = XcvrTableHelper (DEFAULT_NAMESPACE )
2270
2269
task .xcvr_table_helper .get_cfg_port_tbl = mock_table_helper .get_cfg_port_tbl
@@ -2276,7 +2275,7 @@ def test_CmisManagerTask_get_configured_tx_power_from_db(self, mock_table_helper
2276
2275
stop_event = threading .Event ()
2277
2276
task = CmisManagerTask (DEFAULT_NAMESPACE , port_mapping , stop_event )
2278
2277
cfg_port_tbl = MagicMock ()
2279
- cfg_port_tbl .get = MagicMock (return_value = (True , (( 'tx_power' , - 10 ),) ))
2278
+ cfg_port_tbl .hget = MagicMock (return_value = (True , - 10 ))
2280
2279
mock_table_helper .get_cfg_port_tbl = MagicMock (return_value = cfg_port_tbl )
2281
2280
task .xcvr_table_helper = XcvrTableHelper (DEFAULT_NAMESPACE )
2282
2281
task .xcvr_table_helper .get_cfg_port_tbl = mock_table_helper .get_cfg_port_tbl
0 commit comments