From 8875864676a8d8b5fe08a861eb8662947f8fe115 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 15 Feb 2013 16:41:30 +0000 Subject: Handle morphs that are not dicts (By failing) --- morphlib/morph2_tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'morphlib/morph2_tests.py') diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py index a2c44753..61e1744b 100644 --- a/morphlib/morph2_tests.py +++ b/morphlib/morph2_tests.py @@ -164,11 +164,12 @@ class MorphologyTests(unittest.TestCase): ## Validation tests - def test_morphology_must_not_be_empty(self): - # Causes crashes if not handled, because code expecting a dict gets - # None instead. + def test_not_empty(self): self.assertRaises(morphlib.YAMLError, Morphology, '') + def test_is_dict(self): + self.assertRaises(morphlib.YAMLError, Morphology, 'foo') + def test_makes_max_jobs_be_an_integer(self): m = Morphology(''' { -- cgit v1.2.1