BF: give a custom prefix to a tempfile and close it upon tearDown in ExecuteActions tests

pull/694/head
Yaroslav Halchenko 2014-04-16 00:30:46 -04:00
parent 8cb6ec54ac
commit f206c3d493
1 changed files with 2 additions and 1 deletions

View File

@ -35,9 +35,10 @@ class ExecuteActions(unittest.TestCase):
"""Call before every test case."""
self.__jail = DummyJail()
self.__actions = Actions(self.__jail)
self.__tmpfile, self.__tmpfilename = tempfile.mkstemp()
self.__tmpfile, self.__tmpfilename = tempfile.mkstemp('fail2ban', 'executeactions')
def tearDown(self):
os.close(self.__tmpfile)
os.remove(self.__tmpfilename)
def defaultActions(self):