Skip to content

Commit a4ef821

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "cleanup files that are created for swift functional tests"
2 parents b8d8e35 + 27b0ff5 commit a4ef821

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎functional/tests/test_object.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13+
import os
1314
import uuid
1415

1516
from functional.common import test
@@ -25,9 +26,11 @@ class ObjectV1Tests(test.TestCase):
2526
CONTAINER_NAME = uuid.uuid4().hex
2627
OBJECT_NAME = uuid.uuid4().hex
2728

28-
# NOTE(stevemar): Not using setUp since we only want this to run once
29-
with open(OBJECT_NAME, 'w') as f:
30-
f.write('test content')
29+
def setUp(self):
30+
super(ObjectV1Tests, self).setUp()
31+
self.addCleanup(os.remove, self.OBJECT_NAME)
32+
with open(self.OBJECT_NAME, 'w') as f:
33+
f.write('test content')
3134

3235
def test_container_create(self):
3336
raw_output = self.openstack('container create ' + self.CONTAINER_NAME)

0 commit comments

Comments
 (0)