diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-01-18 16:46:07 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-01-18 16:58:47 +0000 |
commit | 186b74b3e602a8a462858a9342edc45f6cccb236 (patch) | |
tree | fadbe4b63598cdf271587417b07dac5349ef098c /morphlib/morphology_tests.py | |
parent | 9d3d5d31b161fd71dd379f6bce14b8d925e17f0f (diff) | |
download | morph-186b74b3e602a8a462858a9342edc45f6cccb236.tar.gz |
add test for malformed morphs
Diffstat (limited to 'morphlib/morphology_tests.py')
-rw-r--r-- | morphlib/morphology_tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/morphology_tests.py b/morphlib/morphology_tests.py index cac80798..2df42315 100644 --- a/morphlib/morphology_tests.py +++ b/morphlib/morphology_tests.py @@ -30,6 +30,16 @@ class MockFile(StringIO.StringIO): class MorphologyTests(unittest.TestCase): + def test_fails_invalid_chunk_morphology(self): + def failtest(): + morph = morphlib.morphology.Morphology( + 'repo', 'ref', + MockFile(''' + { + "name": "hello", + }''')) + self.assertRaises(ValueError, failtest) + def test_accepts_valid_chunk_morphology(self): morph = morphlib.morphology.Morphology( 'repo', 'ref', |