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 <volume> <new_size> error: too few arguments Try 'cinder help extend' for more information. cinder extend 3 usage: cinder extend <volume> <new_size> error: the following arguments are required: <new_size> 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
This commit is contained in:
parent
44e650a4ed
commit
1a5910cbd8
@ -27,7 +27,7 @@ class CinderVolumeExtendNegativeTests(base.ClientTestBase):
|
|||||||
self.volume = self.object_create('volume', params='1')
|
self.volume = self.object_create('volume', params='1')
|
||||||
|
|
||||||
@ddt.data(
|
@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')),
|
('-1', (r'New size for extend must be greater than current size')),
|
||||||
('0', (r'Invalid input received')),
|
('0', (r'Invalid input received')),
|
||||||
('size', (r'invalid int value')),
|
('size', (r'invalid int value')),
|
||||||
@ -43,7 +43,7 @@ class CinderVolumeExtendNegativeTests(base.ClientTestBase):
|
|||||||
params='{0} {1}'.format(self.volume['id'], value))
|
params='{0} {1}'.format(self.volume['id'], value))
|
||||||
|
|
||||||
@ddt.data(
|
@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')),
|
('1234-1234-1234', (r'No volume with a name or ID of')),
|
||||||
('my_volume', (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'))
|
('1234 1234', (r'unrecognized arguments'))
|
||||||
|
Loading…
Reference in New Issue
Block a user