From 7b77a5570a37870eb9a1efaa7fa912927bc7a999 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 18 May 2015 09:48:54 +0200 Subject: [PATCH] Testcases: setUp and tearDown. --- test/test.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test.py b/test/test.py index e66caa2..f6143a2 100644 --- a/test/test.py +++ b/test/test.py @@ -58,12 +58,16 @@ class FormConfigTestCase(unittest.TestCase): self.assertTrue(fc.get_visible_forms() == []) class ScriptFormTestCase(unittest.TestCase): - def testShutdown(self): + def setUp(self): config = copy.deepcopy(base_config) file('test.json', 'w').write(json.dumps(config)) - sf = scriptform.ScriptForm('test.json') - run_server(sf) - sf.shutdown() + self.sf = scriptform.ScriptForm('test.json', cache=False) + run_server(self.sf) + + def tearDown(self): + self.sf.shutdown() + + def testShutdown(self): self.assertTrue(True) if __name__ == '__main__':