diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2017-07-26 11:31:06 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2017-07-26 19:17:46 -0500 |
| commit | 022fdb10ebf5e539fb4d84550d00943d55e5f746 (patch) | |
| tree | c06df73d5f60c45d466b1d28f098f161349c0771 /openstackclient/tests/functional/object/v1/test_container.py | |
| parent | 86bda369638e53a8e9683731e7a5d432640fa813 (diff) | |
| download | python-openstackclient-022fdb10ebf5e539fb4d84550d00943d55e5f746.tar.gz | |
Skip object-store functional tests when Swift is not available
Specifically, in the py3 jobs Swift is not (yet) properly starting as
a py2 service, so we disabled swift in those OSC jobs and need to
skip the object-store functional tests in that case.
Change-Id: I073551c41b7636f04b3ee97dc6fe69630e207b67
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) |
