diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-07-27 15:19:03 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-07-27 15:19:03 +0000 |
| commit | 590dc3ed01df7a31b00416bcc3e6916089626c80 (patch) | |
| tree | 64e2f3da35beaffcde9db115ff14d96eb220a1ac /openstackclient/tests/functional/object/v1/test_container.py | |
| parent | d010c00a1528478ca03d030ca821e74b572cb9d4 (diff) | |
| parent | 022fdb10ebf5e539fb4d84550d00943d55e5f746 (diff) | |
| download | python-openstackclient-590dc3ed01df7a31b00416bcc3e6916089626c80.tar.gz | |
Merge "Skip object-store functional tests when Swift is not available"
Diffstat (limited to 'openstackclient/tests/functional/object/v1/test_container.py')
| -rw-r--r-- | openstackclient/tests/functional/object/v1/test_container.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/openstackclient/tests/functional/object/v1/test_container.py b/openstackclient/tests/functional/object/v1/test_container.py index acfbab11..d66aa842 100644 --- a/openstackclient/tests/functional/object/v1/test_container.py +++ b/openstackclient/tests/functional/object/v1/test_container.py @@ -12,28 +12,37 @@ import uuid -from openstackclient.tests.functional import base +# from openstackclient.tests.functional import base +from openstackclient.tests.functional.object.v1 import common -class ContainerTests(base.TestCase): - """Functional tests for object containers. """ +class ContainerTests(common.ObjectStoreTests): + """Functional tests for Object Store container commands""" NAME = uuid.uuid4().hex @classmethod def setUpClass(cls): super(ContainerTests, cls).setUpClass() - opts = cls.get_opts(['container']) - raw_output = cls.openstack('container create ' + cls.NAME + opts) - cls.assertOutput(cls.NAME + '\n', raw_output) + if cls.haz_object_store: + opts = cls.get_opts(['container']) + raw_output = cls.openstack('container create ' + cls.NAME + opts) + cls.assertOutput(cls.NAME + '\n', raw_output) @classmethod def tearDownClass(cls): try: - raw_output = cls.openstack('container delete ' + cls.NAME) - cls.assertOutput('', raw_output) + if cls.haz_object_store: + raw_output = cls.openstack('container delete ' + cls.NAME) + cls.assertOutput('', raw_output) finally: super(ContainerTests, cls).tearDownClass() + def setUp(self): + super(ContainerTests, self).setUp() + # Skip tests if no object-store is present + if not self.haz_object_store: + self.skipTest("No object-store service present") + def test_container_list(self): opts = self.get_opts(['Name']) raw_output = self.openstack('container list' + opts) |
