diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-07-26 17:14:45 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-07-31 18:08:20 +0200 |
commit | eb08ef73cf2a200fe4279b94792d7353b61027b5 (patch) | |
tree | d71545b3e0b8778c765921a173b348a2ac96542a /morphlib/morphologyfactory_tests.py | |
parent | c65369a965f75b7ce215138480b73c796b671fa1 (diff) | |
download | morph-eb08ef73cf2a200fe4279b94792d7353b61027b5.tar.gz |
Raise clearer error on morphology parse errors
Diffstat (limited to 'morphlib/morphologyfactory_tests.py')
-rw-r--r-- | morphlib/morphologyfactory_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/morphologyfactory_tests.py b/morphlib/morphologyfactory_tests.py index cc45bb21..06cfc5c3 100644 --- a/morphlib/morphologyfactory_tests.py +++ b/morphlib/morphologyfactory_tests.py @@ -63,6 +63,9 @@ class FakeLocalRepo(object): "system-kind": "%(system_kind)s", "arch": "%(arch)s" }''', + 'parse-error.morph': '''{ + "name" + }''', } def __init__(self): @@ -230,3 +233,7 @@ class MorphologyFactoryTests(unittest.TestCase): self.assertRaises(morphlib.Error, self.mf.get_morphology, 'reponame', 'sha1', 'system.morph') + def test_fails_on_parse_error(self): + self.assertRaises(morphlib.Error, self.mf.get_morphology, + 'reponame', 'sha1', 'parse-error.morph') + |