|
438 | 438 | }
|
439 | 439 | """
|
440 | 440 |
|
| 441 | +show_muxcable_firmware_version_all_active_expected_output = """\ |
| 442 | +{ |
| 443 | + "Ethernet12": { |
| 444 | + "version_nic_active": "0.1MS", |
| 445 | + "version_peer_active": "0.1MS", |
| 446 | + "version_self_active": "0.1MS" |
| 447 | + } |
| 448 | +} |
| 449 | +""" |
| 450 | + |
| 451 | + |
441 | 452 |
|
442 | 453 | show_muxcable_firmware_version_active_expected_output = """\
|
443 | 454 | {
|
@@ -1468,6 +1479,26 @@ def test_show_muxcable_firmware_version_all(self):
|
1468 | 1479 | assert result.output == show_muxcable_firmware_version_all_expected_output
|
1469 | 1480 |
|
1470 | 1481 |
|
| 1482 | + @mock.patch('show.muxcable.delete_all_keys_in_db_table', mock.MagicMock(return_value=0)) |
| 1483 | + @mock.patch('show.muxcable.update_and_get_response_for_xcvr_cmd', mock.MagicMock(return_value={0: 0, |
| 1484 | + 1: "True"})) |
| 1485 | + @mock.patch('utilities_common.platform_sfputil_helper.get_logical_list', mock.MagicMock(return_value=["Ethernet0", "Ethernet12"])) |
| 1486 | + @mock.patch('utilities_common.platform_sfputil_helper.get_asic_id_for_logical_port', mock.MagicMock(return_value=0)) |
| 1487 | + @mock.patch('show.muxcable.platform_sfputil', mock.MagicMock(return_value={0: ["Ethernet12", "Ethernet0"]})) |
| 1488 | + @mock.patch('utilities_common.platform_sfputil_helper.get_logical_list', mock.MagicMock(return_value=["Ethernet0", "Ethernet12"])) |
| 1489 | + @mock.patch('utilities_common.platform_sfputil_helper.get_physical_to_logical', mock.MagicMock(return_value={0: ["Ethernet12", "Ethernet0"]})) |
| 1490 | + @mock.patch('utilities_common.platform_sfputil_helper.logical_port_name_to_physical_port_list', mock.MagicMock(return_value=[0])) |
| 1491 | + def test_show_muxcable_firmware_version_all_active(self): |
| 1492 | + runner = CliRunner() |
| 1493 | + db = Db() |
| 1494 | + |
| 1495 | + result = runner.invoke(show.cli.commands["muxcable"].commands["firmware"].commands["version"], [ |
| 1496 | + "all", "--active"], obj=db) |
| 1497 | + assert result.exit_code == 0 |
| 1498 | + f = open("newfile", "w") |
| 1499 | + f.write(result.output) |
| 1500 | + assert result.output == show_muxcable_firmware_version_all_active_expected_output |
| 1501 | + |
1471 | 1502 | @mock.patch('show.muxcable.delete_all_keys_in_db_table', mock.MagicMock(return_value=0))
|
1472 | 1503 | @mock.patch('show.muxcable.update_and_get_response_for_xcvr_cmd', mock.MagicMock(return_value={0: 0,
|
1473 | 1504 | 1: "True"}))
|
|
0 commit comments