Testcases: setUp and tearDown.

pull/7/head
Ferry Boender 10 years ago
parent 8a03c3b3a2
commit 7b77a5570a
  1. 12
      test/test.py

@ -58,12 +58,16 @@ class FormConfigTestCase(unittest.TestCase):
self.assertTrue(fc.get_visible_forms() == []) self.assertTrue(fc.get_visible_forms() == [])
class ScriptFormTestCase(unittest.TestCase): class ScriptFormTestCase(unittest.TestCase):
def testShutdown(self): def setUp(self):
config = copy.deepcopy(base_config) config = copy.deepcopy(base_config)
file('test.json', 'w').write(json.dumps(config)) file('test.json', 'w').write(json.dumps(config))
sf = scriptform.ScriptForm('test.json') self.sf = scriptform.ScriptForm('test.json', cache=False)
run_server(sf) run_server(self.sf)
sf.shutdown()
def tearDown(self):
self.sf.shutdown()
def testShutdown(self):
self.assertTrue(True) self.assertTrue(True)
if __name__ == '__main__': if __name__ == '__main__':

Loading…
Cancel
Save