Skip to content

Commit 2006ead

Browse files
committed
fix all
Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent 62faf15 commit 2006ead

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/muxcable_test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,17 @@
438438
}
439439
"""
440440

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+
441452

442453
show_muxcable_firmware_version_active_expected_output = """\
443454
{
@@ -1468,6 +1479,26 @@ def test_show_muxcable_firmware_version_all(self):
14681479
assert result.output == show_muxcable_firmware_version_all_expected_output
14691480

14701481

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+
14711502
@mock.patch('show.muxcable.delete_all_keys_in_db_table', mock.MagicMock(return_value=0))
14721503
@mock.patch('show.muxcable.update_and_get_response_for_xcvr_cmd', mock.MagicMock(return_value={0: 0,
14731504
1: "True"}))

0 commit comments

Comments
 (0)