From 0396e8a82e76da46d92afda580a63b78602c8e5b Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 25 May 2015 22:03:37 +0200 Subject: [PATCH] Test non-existing forms. --- test/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test.py b/test/test.py index cd96db6..2263725 100644 --- a/test/test.py +++ b/test/test.py @@ -37,6 +37,12 @@ class FormConfigTestCase(unittest.TestCase): if os.path.exists('tmp_stderr'): os.unlink('tmp_stderr') + def testNoSuchForm(self): + """Getting non-existing form should raise ValueError""" + sf = scriptform.ScriptForm('test_formconfig_hidden.json') + fc = sf.get_form_config() + self.assertRaises(ValueError, fc.get_form_def, 'nonexisting') + def testMissing(self): """Missing script callbacks should raise an OSError""" self.assertRaises(OSError, scriptform.ScriptForm, 'test_formconfig_missingscript.json')