diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-01-21 06:18:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-01-21 06:18:08 +0000 |
| commit | bf3f12f5969dff262077c83bdbfa6d934aa43648 (patch) | |
| tree | fdc6922f03f221bd5b736d53c7c1038fe785d09a /openstackclient/tests | |
| parent | 89d9449dcfd4679e8d786c73df4be67af8e3b04a (diff) | |
| parent | f353253122ca39aeb092656cea011a06e70103a4 (diff) | |
| download | python-openstackclient-bf3f12f5969dff262077c83bdbfa6d934aa43648.tar.gz | |
Merge "Error in the return of command 'volume qos create'"
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/functional/volume/v2/test_qos.py | 4 | ||||
| -rw-r--r-- | openstackclient/tests/unit/volume/v2/test_qos_specs.py | 28 |
2 files changed, 17 insertions, 15 deletions
diff --git a/openstackclient/tests/functional/volume/v2/test_qos.py b/openstackclient/tests/functional/volume/v2/test_qos.py index a54acbfd..1558c216 100644 --- a/openstackclient/tests/functional/volume/v2/test_qos.py +++ b/openstackclient/tests/functional/volume/v2/test_qos.py @@ -50,13 +50,13 @@ class QosTests(common.BaseVolumeTests): raw_output = self.openstack( 'volume qos set --property a=b --property c=d ' + self.ID) self.assertEqual("", raw_output) - opts = self.get_opts(['name', 'specs']) + opts = self.get_opts(['name', 'properties']) raw_output = self.openstack('volume qos show ' + self.ID + opts) self.assertEqual(self.NAME + "\na='b', c='d'\n", raw_output) raw_output = self.openstack( 'volume qos unset --property a ' + self.ID) self.assertEqual("", raw_output) - opts = self.get_opts(['name', 'specs']) + opts = self.get_opts(['name', 'properties']) raw_output = self.openstack('volume qos show ' + self.ID + opts) self.assertEqual(self.NAME + "\nc='d'\n", raw_output) diff --git a/openstackclient/tests/unit/volume/v2/test_qos_specs.py b/openstackclient/tests/unit/volume/v2/test_qos_specs.py index 7597e852..35d9a345 100644 --- a/openstackclient/tests/unit/volume/v2/test_qos_specs.py +++ b/openstackclient/tests/unit/volume/v2/test_qos_specs.py @@ -70,24 +70,26 @@ class TestQosAssociate(TestQos): class TestQosCreate(TestQos): - new_qos_spec = volume_fakes.FakeQos.create_one_qos() columns = ( 'consumer', 'id', 'name', - 'specs' - ) - data = ( - new_qos_spec.consumer, - new_qos_spec.id, - new_qos_spec.name, - new_qos_spec.specs + 'properties' ) def setUp(self): super(TestQosCreate, self).setUp() + self.new_qos_spec = volume_fakes.FakeQos.create_one_qos() self.qos_mock.create.return_value = self.new_qos_spec + + self.data = ( + self.new_qos_spec.consumer, + self.new_qos_spec.id, + self.new_qos_spec.name, + utils.format_dict(self.new_qos_spec.specs) + ) + # Get the command object to test self.cmd = qos_specs.CreateQos(self.app, None) @@ -147,11 +149,11 @@ class TestQosCreate(TestQos): columns, data = self.cmd.take_action(parsed_args) - self.new_qos_spec.specs.update( - {'consumer': self.new_qos_spec.consumer}) self.qos_mock.create.assert_called_with( self.new_qos_spec.name, - self.new_qos_spec.specs + {'consumer': self.new_qos_spec.consumer, + 'foo': 'bar', + 'iops': '9001'} ) self.assertEqual(self.columns, columns) @@ -307,7 +309,7 @@ class TestQosList(TestQos): 'Name', 'Consumer', 'Associations', - 'Specs', + 'Properties', ) data = [] for q in qos_specs: @@ -383,7 +385,7 @@ class TestQosShow(TestQos): 'consumer', 'id', 'name', - 'specs' + 'properties' ) data = ( qos_association.name, |
