Skip to content

Commit e5f77f6

Browse files
authored
Fix unit test assertions broken by spelling typo PRs (#4321)
What is the motivation for this PR Fix unit test assertions broken by recent spelling correction PRs, and revert the 'Neighbhor' → 'Neighbor' header change which is intentionally preserved for backward compatibility. How did you do it Updated test expected strings to match corrected source messages and restored the 'Neighbhor' header in bgp_util.py. How did you verify/test it Not provided in PR description. Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
1 parent 7660b19 commit e5f77f6

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

tests/config_mirror_session_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_mirror_session_span_add():
260260
config.config.commands["mirror_session"].commands["span"].commands["add"],
261261
["test_session", "Ethernet52", "Ethernet52", "rx", "100"])
262262
assert result.exit_code != 0
263-
assert "Error: Destination Interface cant be same as Source Interface" in result.stdout
263+
assert "Error: Destination Interface can't be same as Source Interface" in result.stdout
264264

265265
# Verify destination port not have mirror config
266266
result = runner.invoke(

tests/remote_cli_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_rexec_error(self):
155155
rexec.cli, [LINECARD_NAME, "-c", "show version"])
156156
print(result.output)
157157
assert result.exit_code == 1, result.output
158-
assert "This commmand is only supported Chassis" in result.output
158+
assert "This command is only supported Chassis" in result.output
159159

160160
@mock.patch("sonic_py_common.device_info.is_chassis", mock.MagicMock(return_value=True))
161161
@mock.patch("os.getlogin", mock.MagicMock(return_value="admin"))
@@ -318,4 +318,4 @@ def test_rcli_error(self):
318318
result = runner.invoke(rshell.cli, [LINECARD_NAME])
319319
print(result.output)
320320
assert result.exit_code == 1, result.output
321-
assert "This commmand is only supported Chassis" in result.output
321+
assert "This command is only supported Chassis" in result.output

tests/show_ip_route_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@
794794
"""
795795

796796
show_ip_route_multi_asic_invalid_display_err_output = """\
797-
dislay option 'everything' is not a valid option.
797+
display option 'everything' is not a valid option.
798798
"""
799799

800800
show_ip_route_multi_asic_specific_route_output = """\

tests/sku_create_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def test_set_lanes_error(self, mock_print):
525525
sku.fpp_split = {1: [['etp1a', 'etp1b'], [1, 2]]}
526526
sku.default_lanes_per_port = ['0,1,2', '3,4,5', '6,7,8']
527527
sku.set_lanes()
528-
mock_print.assert_called_once_with("Lanes(0,1,2) could not be evenly splitted by 2.")
528+
mock_print.assert_called_once_with("Lanes(0,1,2) could not be evenly split by 2.")
529529
assert e.value.code == 1
530530

531531
@patch('builtins.print')

tests/static_routes_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Error: argument is incomplete, nexthop not found!
2020
'''
2121
ERROR_STR_DEL_NONEXIST_KEY = '''
22-
Error: Route {} doesnt exist
22+
Error: Route {} doesn't exist
2323
'''
2424
ERROR_STR_DEL_NONEXIST_ENTRY = '''
2525
Error: Not found {} in {}

tests/vnet_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_vnet_add_del_route(self):
285285
# Test vnet add route when vnet doesnt exist
286286
args = ["Vnet_6", "10.10.10.10/32", "10.10.10.1"]
287287
result = runner.invoke(config.config.commands["vnet"].commands["add-route"], args, obj=vnet_obj)
288-
assert "VNET Vnet_6 doesnot exist, cannot add a route!" in result.output
288+
assert "VNET Vnet_6 does not exist, cannot add a route!" in result.output
289289
assert result.exit_code != 0
290290

291291
# Test vnet add route using length of vnet name
@@ -348,13 +348,13 @@ def test_vnet_add_del_route(self):
348348
result = runner.invoke(config.config.commands["vnet"].commands["del-route"], args, obj=vnet_obj)
349349
assert result.exit_code != 0
350350
assert ('Vnet_100') not in db.cfgdb.get_table('VNET')
351-
assert "VNET Vnet_100 doesnot exist, cannot delete the route!" in result.output
351+
assert "VNET Vnet_100 does not exist, cannot delete the route!" in result.output
352352

353353
# Test vnet del route with non existent route
354354
args = ["Vnet3", "10.10.10.10/32"]
355355
result = runner.invoke(config.config.commands["vnet"].commands["del-route"], args, obj=vnet_obj)
356356
assert result.exit_code != 0
357-
assert "Routes dont exist for the VNET Vnet3, cant delete it!" in result.output
357+
assert "Routes dont exist for the VNET Vnet3, can't delete it!" in result.output
358358

359359
def test_vnet_add_del_2(self):
360360
runner = CliRunner()

utilities_common/bgp_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ def display_bgp_summary(bgp_summary, af):
333333
334334
'''
335335

336-
# "Neighbor" is a known typo,
336+
# "Neighbhor" is a known typo,
337337
# but fix it will impact lots of automation scripts that the community users may have developed for years
338338
# for now, let's keep it as it is.
339-
headers = ["Neighbor", "V", "AS", "MsgRcvd", "MsgSent", "TblVer",
339+
headers = ["Neighbhor", "V", "AS", "MsgRcvd", "MsgSent", "TblVer",
340340
"InQ", "OutQ", "Up/Down", "State/PfxRcd", "NeighborName"]
341341

342342
try:

0 commit comments

Comments
 (0)