diff --git a/test/test.py b/test/test.py index 9fe35d6..b784446 100644 --- a/test/test.py +++ b/test/test.py @@ -261,6 +261,13 @@ class FormDefinitionTest(unittest.TestCase): self.assertRaises(KeyError, fd.validate, form_values) +class FormDefinitionFieldMissingProperty(unittest.TestCase): + """ + """ + def testMissing(self): + self.assertRaises(KeyError, scriptform.ScriptForm, 'test_formdefinition_missing_title.json') + + class WebAppTest(unittest.TestCase): """ Test the web app by actually running the server and making web calls to it. diff --git a/test/test_formdefinition_missing_title.json b/test/test_formdefinition_missing_title.json new file mode 100644 index 0000000..e1655f7 --- /dev/null +++ b/test/test_formdefinition_missing_title.json @@ -0,0 +1,17 @@ +{ + "title": "test", + "forms": [ + { + "name": "test", + "title": "title", + "description": "description", + "script": "test.sh", + "fields": [ + { + "name": "string", + "type": "string" + } + ] + } + ] +}