summaryrefslogtreecommitdiff
path: root/dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-11-12 15:32:09 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-11-12 15:32:09 +0000
commitd1edfd3a57afc1db57e14cc58d3f28eea8eefd64 (patch)
treed5315c32caabd5ea57f0557a1b17681a6e12a435 /dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch
parent983485e93d76602266889d23c963609073b75e51 (diff)
gentoo auto-resync : 12:11:2022 - 15:32:08
Diffstat (limited to 'dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch')
-rw-r--r--dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch b/dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch
new file mode 100644
index 000000000000..863e4d93b298
--- /dev/null
+++ b/dev-python/python-cinderclient/files/python-cinderclient-9.1.0-fix-py3.11-argparse.patch
@@ -0,0 +1,54 @@
+https://review.opendev.org/c/openstack/python-cinderclient/+/851467
+From: Cyril Roelandt <cyril@redhat.com>
+Date: Thu, 28 Jul 2022 20:48:58 +0200
+Subject: [PATCH] Python3.11: Fix argparse-related test failures
+
+Closes-Bug: #1983054
+Change-Id: I2d4cb81a394f3c10e5f01945d894746a904fb5df
+--- a/cinderclient/tests/unit/test_shell.py
++++ b/cinderclient/tests/unit/test_shell.py
+@@ -376,7 +376,7 @@
+
+ self.mock_completion()
+
+- def test_load_versioned_actions(self):
++ def test_load_versioned_actions_v3_0(self):
+ parser = cinderclient.shell.CinderClientArgumentParser()
+ subparsers = parser.add_subparsers(metavar='<subcommand>')
+ shell = cinderclient.shell.OpenStackCinderShell()
+@@ -388,6 +388,10 @@
+ "fake_action 3.0 to 3.1",
+ shell.subcommands['fake-action'].get_default('func')())
+
++ def test_load_versioned_actions_v3_2(self):
++ parser = cinderclient.shell.CinderClientArgumentParser()
++ subparsers = parser.add_subparsers(metavar='<subcommand>')
++ shell = cinderclient.shell.OpenStackCinderShell()
+ shell.subcommands = {}
+ shell._find_actions(subparsers, fake_actions_module,
+ api_versions.APIVersion("3.2"), False, [])
+@@ -521,7 +525,7 @@
+
+ @mock.patch.object(cinderclient.shell.CinderClientArgumentParser,
+ 'add_argument')
+- def test_load_actions_with_versioned_args(self, mock_add_arg):
++ def test_load_actions_with_versioned_args_v36(self, mock_add_arg):
+ parser = cinderclient.shell.CinderClientArgumentParser(add_help=False)
+ subparsers = parser.add_subparsers(metavar='<subcommand>')
+ shell = cinderclient.shell.OpenStackCinderShell()
+@@ -533,8 +537,13 @@
+ self.assertNotIn(mock.call('--foo', help="second foo"),
+ mock_add_arg.call_args_list)
+
+- mock_add_arg.reset_mock()
+-
++ @mock.patch.object(cinderclient.shell.CinderClientArgumentParser,
++ 'add_argument')
++ def test_load_actions_with_versioned_args_v39(self, mock_add_arg):
++ parser = cinderclient.shell.CinderClientArgumentParser(add_help=False)
++ subparsers = parser.add_subparsers(metavar='<subcommand>')
++ shell = cinderclient.shell.OpenStackCinderShell()
++ shell.subcommands = {}
+ shell._find_actions(subparsers, fake_actions_module,
+ api_versions.APIVersion("3.9"), False, [])
+ self.assertNotIn(mock.call('--foo', help="first foo"),