diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2014-11-12 12:07:43 -0500 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-11-12 16:45:21 -0500 |
| commit | 27b0ff5cdaf5e446d60ae6a6201a7ce0132a13a4 (patch) | |
| tree | 8eb032b6f917be766426272e2d48945be48f4750 /functional | |
| parent | c8ddfd83119c4ea5aec4d8b1ffdb7b45953743af (diff) | |
| download | python-openstackclient-27b0ff5cdaf5e446d60ae6a6201a7ce0132a13a4.tar.gz | |
cleanup files that are created for swift functional tests
Currently this portion of code is also being run when running
tox to debug local tests. Which is very annoying since a developer
will end up with a bunch of uuid files. Rather than creating it
once per run, we can have a setup/teardown that is handled safely.
Change-Id: I49a0bb3d14f24c54da93458d1e3b9093a1120453
Diffstat (limited to 'functional')
| -rw-r--r-- | functional/tests/test_object.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/functional/tests/test_object.py b/functional/tests/test_object.py index 396f0cb7..4121524a 100644 --- a/functional/tests/test_object.py +++ b/functional/tests/test_object.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import os import uuid from functional.common import test @@ -25,9 +26,11 @@ class ObjectV1Tests(test.TestCase): CONTAINER_NAME = uuid.uuid4().hex OBJECT_NAME = uuid.uuid4().hex - # NOTE(stevemar): Not using setUp since we only want this to run once - with open(OBJECT_NAME, 'w') as f: - f.write('test content') + def setUp(self): + super(ObjectV1Tests, self).setUp() + self.addCleanup(os.remove, self.OBJECT_NAME) + with open(self.OBJECT_NAME, 'w') as f: + f.write('test content') def test_container_create(self): raw_output = self.openstack('container create ' + self.CONTAINER_NAME) |
