summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/volume/v3
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/functional/volume/v3')
-rw-r--r--openstackclient/tests/functional/volume/v3/common.py11
-rw-r--r--openstackclient/tests/functional/volume/v3/test_qos.py10
-rw-r--r--openstackclient/tests/functional/volume/v3/test_snapshot.py9
-rw-r--r--openstackclient/tests/functional/volume/v3/test_transfer_request.py9
-rw-r--r--openstackclient/tests/functional/volume/v3/test_volume.py9
-rw-r--r--openstackclient/tests/functional/volume/v3/test_volume_type.py9
6 files changed, 17 insertions, 40 deletions
diff --git a/openstackclient/tests/functional/volume/v3/common.py b/openstackclient/tests/functional/volume/v3/common.py
index bc8befa6..a710a683 100644
--- a/openstackclient/tests/functional/volume/v3/common.py
+++ b/openstackclient/tests/functional/volume/v3/common.py
@@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import os
+import fixtures
from openstackclient.tests.functional.volume import base
@@ -18,6 +18,9 @@ from openstackclient.tests.functional.volume import base
class BaseVolumeTests(base.BaseVolumeTests):
"""Base class for Volume functional tests. """
- @classmethod
- def setUpClass(cls):
- os.environ['OS_VOLUME_API_VERSION'] = '3'
+ def setUp(self):
+ super(BaseVolumeTests, self).setUp()
+ ver_fixture = fixtures.EnvironmentVariable(
+ 'OS_VOLUME_API_VERSION', '3'
+ )
+ self.useFixture(ver_fixture)
diff --git a/openstackclient/tests/functional/volume/v3/test_qos.py b/openstackclient/tests/functional/volume/v3/test_qos.py
index a7af3c5b..a6290fc5 100644
--- a/openstackclient/tests/functional/volume/v3/test_qos.py
+++ b/openstackclient/tests/functional/volume/v3/test_qos.py
@@ -10,15 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-import os
-
from openstackclient.tests.functional.volume.v2 import test_qos as v2
+from openstackclient.tests.functional.volume.v3 import common
-class QosTests(v2.QosTests):
+class QosTests(common.BaseVolumeTests, v2.QosTests):
"""Functional tests for volume qos. """
-
- @classmethod
- def setUpClass(cls):
- super(QosTests, cls).setUpClass()
- os.environ['OS_VOLUME_API_VERSION'] = '3'
diff --git a/openstackclient/tests/functional/volume/v3/test_snapshot.py b/openstackclient/tests/functional/volume/v3/test_snapshot.py
index bf05b9de..38e0563a 100644
--- a/openstackclient/tests/functional/volume/v3/test_snapshot.py
+++ b/openstackclient/tests/functional/volume/v3/test_snapshot.py
@@ -11,13 +11,8 @@
# under the License.
from openstackclient.tests.functional.volume.v2 import test_snapshot as v2
-import os
+from openstackclient.tests.functional.volume.v3 import common
-class VolumeSnapshotTests(v2.VolumeSnapshotTests):
+class VolumeSnapshotTests(common.BaseVolumeTests, v2.VolumeSnapshotTests):
"""Functional tests for volume snapshot. """
-
- @classmethod
- def setUpClass(cls):
- super(VolumeSnapshotTests, cls).setUpClass()
- os.environ['OS_VOLUME_API_VERSION'] = '3'
diff --git a/openstackclient/tests/functional/volume/v3/test_transfer_request.py b/openstackclient/tests/functional/volume/v3/test_transfer_request.py
index 7b54dd20..b3253237 100644
--- a/openstackclient/tests/functional/volume/v3/test_transfer_request.py
+++ b/openstackclient/tests/functional/volume/v3/test_transfer_request.py
@@ -12,13 +12,8 @@
from openstackclient.tests.functional.volume.v2 import test_transfer_request \
as v2
-import os
+from openstackclient.tests.functional.volume.v3 import common
-class TransferRequestTests(v2.TransferRequestTests):
+class TransferRequestTests(common.BaseVolumeTests, v2.TransferRequestTests):
"""Functional tests for transfer request. """
-
- @classmethod
- def setUpClass(cls):
- super(TransferRequestTests, cls).setUpClass()
- os.environ['OS_VOLUME_API_VERSION'] = '3'
diff --git a/openstackclient/tests/functional/volume/v3/test_volume.py b/openstackclient/tests/functional/volume/v3/test_volume.py
index 333826d8..283b830f 100644
--- a/openstackclient/tests/functional/volume/v3/test_volume.py
+++ b/openstackclient/tests/functional/volume/v3/test_volume.py
@@ -11,13 +11,8 @@
# under the License.
from openstackclient.tests.functional.volume.v2 import test_volume as v2
-import os
+from openstackclient.tests.functional.volume.v3 import common
-class VolumeTests(v2.VolumeTests):
+class VolumeTests(common.BaseVolumeTests, v2.VolumeTests):
"""Functional tests for volume. """
-
- @classmethod
- def setUpClass(cls):
- super(VolumeTests, cls).setUpClass()
- os.environ['OS_VOLUME_API_VERSION'] = '3'
diff --git a/openstackclient/tests/functional/volume/v3/test_volume_type.py b/openstackclient/tests/functional/volume/v3/test_volume_type.py
index f10e64b4..eb66515e 100644
--- a/openstackclient/tests/functional/volume/v3/test_volume_type.py
+++ b/openstackclient/tests/functional/volume/v3/test_volume_type.py
@@ -11,13 +11,8 @@
# under the License.
from openstackclient.tests.functional.volume.v2 import test_volume_type as v2
-import os
+from openstackclient.tests.functional.volume.v3 import common
-class VolumeTypeTests(v2.VolumeTypeTests):
+class VolumeTypeTests(common.BaseVolumeTests, v2.VolumeTypeTests):
"""Functional tests for volume type. """
-
- @classmethod
- def setUpClass(cls):
- super(VolumeTypeTests, cls).setUpClass()
- os.environ['OS_VOLUME_API_VERSION'] = '3'