Skip to content

Commit e23f23c

Browse files
committed
Tests: Fix test_shell in py3.13
Whitespace handling has changed in py3.13 around this area -- rework the test to pass on 3.13 as well as older versions by ignoring whitespace around the expected description. There may be a more complete fix in shell.py's _find_actions but I didn't find it for now. Closes-Bug: #2081633 Change-Id: I83a6a2bc311545811c5c32192494ee82b7903770
1 parent 7e30ba3 commit e23f23c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cinderclient/tests/unit/test_shell.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,14 @@ def test_load_versioned_actions_with_help(self):
437437
expected_help = ("help message (Supported by API versions "
438438
"%(start)s - %(end)s)") % {
439439
'start': '3.0', 'end': '3.3'}
440-
expected_desc = ("help message\n\n "
441-
"This will not show up in help message\n ")
440+
self.assertIn('help message',
441+
mock_add_parser.call_args_list[0][1]['description'])
442+
self.assertIn('This will not show up in help message',
443+
mock_add_parser.call_args_list[0][1]['description'])
442444
mock_add_parser.assert_any_call(
443445
'fake-action',
444446
help=expected_help,
445-
description=expected_desc,
447+
description=mock.ANY,
446448
add_help=False,
447449
formatter_class=cinderclient.shell.OpenStackHelpFormatter)
448450

0 commit comments

Comments
 (0)