]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1704] Move test directory creation to setUp() / tearDown()
authorMukund Sivaraman <muks@isc.org>
Mon, 28 May 2012 04:55:47 +0000 (10:25 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 28 May 2012 04:55:47 +0000 (10:25 +0530)
src/bin/bind10/tests/bind10_test.py.in

index 345e053cd42488856a0b75f5e18db963d1189733..8c3afe7ee286ed5fafdbccf7569b010215ddf080 100644 (file)
@@ -1464,10 +1464,14 @@ class SocketSrvTest(unittest.TestCase):
         self.assertTrue(sock.closed)
 
 class TestFunctions(unittest.TestCase):
-    def test_remove_lock_files(self):
+    def setUp(self):
         if not os.path.isdir(os.environ["LOCKFILE_TESTPATH"]):
             os.mkdir(os.environ["LOCKFILE_TESTPATH"])
 
+    def tearDown(self):
+        os.rmdir(os.environ["LOCKFILE_TESTPATH"])
+
+    def test_remove_lock_files(self):
         if "B10_FROM_BUILD" in os.environ:
             oldenv = os.environ["B10_FROM_BUILD"]
         else:
@@ -1493,8 +1497,6 @@ class TestFunctions(unittest.TestCase):
         # second call should not assert anyway
         bind10_src.remove_lock_files()
 
-        os.rmdir(os.environ["LOCKFILE_TESTPATH"])
-
         if oldenv is not None:
             os.environ["B10_FROM_BUILD"] = oldenv
         else: