From 1a5910cbd822e9b1779aba2c69d4ed7ca449ed88 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Mon, 12 Jun 2017 19:49:47 +0800 Subject: [PATCH] Fix PY2/PY3 specific error in testcases The behaviour of PY3's standard lib 'argparse' differs from PY2's. ``` cinder extend 2 usage: cinder extend error: too few arguments Try 'cinder help extend' for more information. cinder extend 3 usage: cinder extend error: the following arguments are required: Try 'cinder help extend' for more information. ``` This could lead to the partly failure of functional testcase, fix it. Change-Id: I59e9ae149af0b4294b09a94a52a4bc86a1d90f2b Closes-Bug: #1697428 --- cinderclient/tests/functional/test_volume_extend_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinderclient/tests/functional/test_volume_extend_cli.py b/cinderclient/tests/functional/test_volume_extend_cli.py index 5e1020c54..f08c875c5 100644 --- a/cinderclient/tests/functional/test_volume_extend_cli.py +++ b/cinderclient/tests/functional/test_volume_extend_cli.py @@ -27,7 +27,7 @@ class CinderVolumeExtendNegativeTests(base.ClientTestBase): self.volume = self.object_create('volume', params='1') @ddt.data( - ('', (r'too few arguments')), + ('', (r'too few arguments|the following arguments are required')), ('-1', (r'New size for extend must be greater than current size')), ('0', (r'Invalid input received')), ('size', (r'invalid int value')), @@ -43,7 +43,7 @@ class CinderVolumeExtendNegativeTests(base.ClientTestBase): params='{0} {1}'.format(self.volume['id'], value)) @ddt.data( - ('', (r'too few arguments')), + ('', (r'too few arguments|the following arguments are required')), ('1234-1234-1234', (r'No volume with a name or ID of')), ('my_volume', (r'No volume with a name or ID of')), ('1234 1234', (r'unrecognized arguments'))