diff options
| author | Rui Chen <chenrui.momo@gmail.com> | 2017-06-06 21:03:33 +0800 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2017-07-20 16:39:32 +0000 |
| commit | f1d32dbe9b6f5f2e47853b9969483fa841e451f4 (patch) | |
| tree | 1149b1d37c63a81caa58c9f6613f0726b9ddb3b5 /openstackclient/tests/functional/object | |
| parent | ac8cac4b63590e3b583faee88b6c481f2f3e9d9a (diff) | |
| download | python-openstackclient-f1d32dbe9b6f5f2e47853b9969483fa841e451f4.tar.gz | |
Clean up the changes of os.environ in functional tests
Use fixtures to restore the API version changes of os.environ
in each functional tests, aims to avoid the following test cases
failing in unexpected context.
And make sure setUpClass/tearDownClass call super class's
corresponding methods first.
Change-Id: Ie248fe9d3a9e25f1b076c9f2c363200f29a83817
Closes-Bug: #1696080
Diffstat (limited to 'openstackclient/tests/functional/object')
| -rw-r--r-- | openstackclient/tests/functional/object/v1/test_container.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/object/v1/test_container.py b/openstackclient/tests/functional/object/v1/test_container.py index af76efd9..acfbab11 100644 --- a/openstackclient/tests/functional/object/v1/test_container.py +++ b/openstackclient/tests/functional/object/v1/test_container.py @@ -21,14 +21,18 @@ class ContainerTests(base.TestCase): @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) @classmethod def tearDownClass(cls): - raw_output = cls.openstack('container delete ' + cls.NAME) - cls.assertOutput('', raw_output) + try: + raw_output = cls.openstack('container delete ' + cls.NAME) + cls.assertOutput('', raw_output) + finally: + super(ContainerTests, cls).tearDownClass() def test_container_list(self): opts = self.get_opts(['Name']) |
