@@ -1294,9 +1294,7 @@ def test_module_fw_upgrade(self, input_param, mock_response, expected):
12941294 'nominal_bit_rate' : 0 ,
12951295 'specification_compliance' : 'sm_media_interface' ,
12961296 'application_advertisement' : 'N/A' ,
1297- 'active_firmware' : '0.3.0' ,
12981297 'media_lane_count' : 1 ,
1299- 'inactive_firmware' : '0.2.0' ,
13001298 'vendor_rev' : '0.0' ,
13011299 'host_electrical_interface' : '400GAUI-8 C2M (Annex 120E)' ,
13021300 'vendor_oui' : 'xx-xx-xx' ,
@@ -2374,13 +2372,19 @@ def mock_read_raw(offset, size):
23742372 assert 0 , traceback .format_exc ()
23752373 run_num -= 1
23762374
2377- def test_get_transceiver_info_firmware_versions_negative_tests (self ):
2375+ def test_get_transceiver_info_firmware_versions (self ):
23782376 self .api .get_module_fw_info = MagicMock ()
23792377 self .api .get_module_fw_info .return_value = None
2378+ expected_result = {"active_firmware" : "N/A" , "inactive_firmware" : "N/A" }
23802379 result = self .api .get_transceiver_info_firmware_versions ()
2381- assert result == [ "N/A" , "N/A" ]
2380+ assert result == expected_result
23822381
23832382 self .api .get_module_fw_info = MagicMock ()
23842383 self .api .get_module_fw_info .side_effect = {'result' : TypeError }
23852384 result = self .api .get_transceiver_info_firmware_versions ()
2386- assert result == ["N/A" , "N/A" ]
2385+ assert result == expected_result
2386+
2387+ expected_result = {"active_firmware" : "2.0.0" , "inactive_firmware" : "1.0.0" }
2388+ self .api .get_module_fw_info .side_effect = [{'result' : ( '' , '' , '' , '' , '' , '' , '' , '' ,'2.0.0' , '1.0.0' )}]
2389+ result = self .api .get_transceiver_info_firmware_versions ()
2390+ assert result == expected_result
0 commit comments