From: Mukund Sivaraman Date: Mon, 28 May 2012 04:55:47 +0000 (+0530) Subject: [1704] Move test directory creation to setUp() / tearDown() X-Git-Tag: trac2351_base~226^2~60^2^2~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e72bc121a7f7e4a85f889a6c1c4eec5bafd51325;p=thirdparty%2Fkea.git [1704] Move test directory creation to setUp() / tearDown() --- diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in index 345e053cd4..8c3afe7ee2 100644 --- a/src/bin/bind10/tests/bind10_test.py.in +++ b/src/bin/bind10/tests/bind10_test.py.in @@ -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: