diff options
| author | Kyrylo Romanenko <kromanenko@mirantis.com> | 2016-07-05 12:16:18 +0300 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2016-07-05 15:39:03 +0000 |
| commit | 259b4a14628b5eae5f9154a052381145e7e7ba1e (patch) | |
| tree | f3449aa2857717436e1b4128a6e713a60f566783 /functional/tests/volume/v1 | |
| parent | 44d4188149faa53d377adf6af6a64a1f6403ce43 (diff) | |
| download | python-openstackclient-259b4a14628b5eae5f9154a052381145e7e7ba1e.tar.gz | |
Deduplicate get_opts methods
One get_opts method can work instead of
get_list_opts and get_show_opts both.
Remove mutable default value.
Change-Id: I9c5683d416f0f3ed4989abab6f152b0341e30a4f
Diffstat (limited to 'functional/tests/volume/v1')
| -rw-r--r-- | functional/tests/volume/v1/test_qos.py | 8 | ||||
| -rw-r--r-- | functional/tests/volume/v1/test_volume.py | 12 | ||||
| -rw-r--r-- | functional/tests/volume/v1/test_volume_type.py | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/functional/tests/volume/v1/test_qos.py b/functional/tests/volume/v1/test_qos.py index 9324830c..5aed4bd0 100644 --- a/functional/tests/volume/v1/test_qos.py +++ b/functional/tests/volume/v1/test_qos.py @@ -26,7 +26,7 @@ class QosTests(common.BaseVolumeTests): @classmethod def setUpClass(cls): super(QosTests, cls).setUpClass() - opts = cls.get_show_opts(cls.FIELDS) + opts = cls.get_opts(cls.FIELDS) raw_output = cls.openstack('volume qos create ' + cls.NAME + opts) cls.ID, name, rol = raw_output.split('\n') cls.assertOutput(cls.NAME, name) @@ -37,12 +37,12 @@ class QosTests(common.BaseVolumeTests): cls.assertOutput('', raw_output) def test_volume_qos_list(self): - opts = self.get_list_opts(self.HEADERS) + opts = self.get_opts(self.HEADERS) raw_output = self.openstack('volume qos list' + opts) self.assertIn(self.NAME, raw_output) def test_volume_qos_show(self): - opts = self.get_show_opts(self.FIELDS) + opts = self.get_opts(self.FIELDS) raw_output = self.openstack('volume qos show ' + self.ID + opts) self.assertEqual(self.ID + "\n" + self.NAME + "\n", raw_output) @@ -50,6 +50,6 @@ 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_show_opts(['name', 'specs']) + opts = self.get_opts(['name', 'specs']) raw_output = self.openstack('volume qos show ' + self.ID + opts) self.assertEqual(self.NAME + "\na='b', c='d'\n", raw_output) diff --git a/functional/tests/volume/v1/test_volume.py b/functional/tests/volume/v1/test_volume.py index f574075d..8275bf0a 100644 --- a/functional/tests/volume/v1/test_volume.py +++ b/functional/tests/volume/v1/test_volume.py @@ -26,7 +26,7 @@ class VolumeTests(common.BaseVolumeTests): @classmethod def setUpClass(cls): super(VolumeTests, cls).setUpClass() - opts = cls.get_show_opts(cls.FIELDS) + opts = cls.get_opts(cls.FIELDS) raw_output = cls.openstack('volume create --size 1 ' + cls.NAME + opts) expected = cls.NAME + '\n' cls.assertOutput(expected, raw_output) @@ -42,12 +42,12 @@ class VolumeTests(common.BaseVolumeTests): cls.assertOutput('', raw_output) def test_volume_list(self): - opts = self.get_list_opts(self.HEADERS) + opts = self.get_opts(self.HEADERS) raw_output = self.openstack('volume list' + opts) self.assertIn(self.NAME, raw_output) def test_volume_show(self): - opts = self.get_show_opts(self.FIELDS) + opts = self.get_opts(self.FIELDS) raw_output = self.openstack('volume show ' + self.NAME + opts) self.assertEqual(self.NAME + "\n", raw_output) @@ -55,7 +55,7 @@ class VolumeTests(common.BaseVolumeTests): raw_output = self.openstack( 'volume set --property a=b --property c=d ' + self.NAME) self.assertEqual("", raw_output) - opts = self.get_show_opts(["properties"]) + opts = self.get_opts(["properties"]) raw_output = self.openstack('volume show ' + self.NAME + opts) self.assertEqual("a='b', c='d'\n", raw_output) @@ -66,12 +66,12 @@ class VolumeTests(common.BaseVolumeTests): def test_volume_set(self): self.openstack('volume set --description RAMAC ' + self.NAME) - opts = self.get_show_opts(["display_description", "display_name"]) + opts = self.get_opts(["display_description", "display_name"]) raw_output = self.openstack('volume show ' + self.NAME + opts) self.assertEqual("RAMAC\n" + self.NAME + "\n", raw_output) def test_volume_set_size(self): self.openstack('volume set --size 2 ' + self.NAME) - opts = self.get_show_opts(["display_name", "size"]) + opts = self.get_opts(["display_name", "size"]) raw_output = self.openstack('volume show ' + self.NAME + opts) self.assertEqual(self.NAME + "\n2\n", raw_output) diff --git a/functional/tests/volume/v1/test_volume_type.py b/functional/tests/volume/v1/test_volume_type.py index 5f1f957e..ed44f3c3 100644 --- a/functional/tests/volume/v1/test_volume_type.py +++ b/functional/tests/volume/v1/test_volume_type.py @@ -26,7 +26,7 @@ class VolumeTypeTests(common.BaseVolumeTests): @classmethod def setUpClass(cls): super(VolumeTypeTests, cls).setUpClass() - opts = cls.get_show_opts(cls.FIELDS) + opts = cls.get_opts(cls.FIELDS) raw_output = cls.openstack('volume type create ' + cls.NAME + opts) expected = cls.NAME + '\n' cls.assertOutput(expected, raw_output) @@ -37,12 +37,12 @@ class VolumeTypeTests(common.BaseVolumeTests): cls.assertOutput('', raw_output) def test_volume_type_list(self): - opts = self.get_list_opts(self.HEADERS) + opts = self.get_opts(self.HEADERS) raw_output = self.openstack('volume type list' + opts) self.assertIn(self.NAME, raw_output) def test_volume_type_show(self): - opts = self.get_show_opts(self.FIELDS) + opts = self.get_opts(self.FIELDS) raw_output = self.openstack('volume type show ' + self.NAME + opts) self.assertEqual(self.NAME + "\n", raw_output) @@ -51,7 +51,7 @@ class VolumeTypeTests(common.BaseVolumeTests): 'volume type set --property a=b --property c=d ' + self.NAME) self.assertEqual("", raw_output) - opts = self.get_show_opts(["properties"]) + opts = self.get_opts(["properties"]) raw_output = self.openstack('volume type show ' + self.NAME + opts) self.assertEqual("a='b', c='d'\n", raw_output) |
