summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_pastedeploy.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_pastedeploy.py')
-rw-r--r--tests/unit/test_pastedeploy.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/unit/test_pastedeploy.py b/tests/unit/test_pastedeploy.py
index 9746fe5..817eb47 100644
--- a/tests/unit/test_pastedeploy.py
+++ b/tests/unit/test_pastedeploy.py
@@ -16,7 +16,9 @@
import os
import tempfile
-import unittest
+
+import fixtures
+import testtools
from openstack.common import pastedeploy
@@ -41,27 +43,20 @@ class Filter(object):
self.data = data
-class PasteTestCase(unittest.TestCase):
+class PasteTestCase(testtools.TestCase):
def setUp(self):
- self.tempfiles = []
-
- def tearDown(self):
- self.remove_tempfiles()
+ super(PasteTestCase, self).setUp()
+ self.useFixture(fixtures.NestedTempfile())
def create_tempfile(self, contents):
(fd, path) = tempfile.mkstemp()
- self.tempfiles.append(path)
try:
os.write(fd, contents)
finally:
os.close(fd)
return path
- def remove_tempfiles(self):
- for p in self.tempfiles:
- os.remove(p)
-
def test_app_factory(self):
data = 'test_app_factory'