summaryrefslogtreecommitdiff
path: root/functional
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-11-13 17:16:27 +0000
committerGerrit Code Review <review@openstack.org>2014-11-13 17:16:27 +0000
commita4ef8214381515376093b4d36b213e50e6e5dcf3 (patch)
tree2e9c187c0ab241ba6b0459adaca75ac1afe60798 /functional
parentb8d8e35a27e9f8b8c905b4b6fb0519c83d647d3b (diff)
parent27b0ff5cdaf5e446d60ae6a6201a7ce0132a13a4 (diff)
downloadpython-openstackclient-a4ef8214381515376093b4d36b213e50e6e5dcf3.tar.gz
Merge "cleanup files that are created for swift functional tests"
Diffstat (limited to 'functional')
-rw-r--r--functional/tests/test_object.py9
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)