summaryrefslogtreecommitdiff
path: root/morphlib/morphology_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-01-18 16:46:07 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-01-18 16:58:47 +0000
commit186b74b3e602a8a462858a9342edc45f6cccb236 (patch)
treefadbe4b63598cdf271587417b07dac5349ef098c /morphlib/morphology_tests.py
parent9d3d5d31b161fd71dd379f6bce14b8d925e17f0f (diff)
downloadmorph-186b74b3e602a8a462858a9342edc45f6cccb236.tar.gz
add test for malformed morphs
Diffstat (limited to 'morphlib/morphology_tests.py')
-rw-r--r--morphlib/morphology_tests.py10
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',