From 0710a1529a7af7e33179c71a30d362dd46281d3f Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 8 Aug 2014 09:58:59 +0000 Subject: unittests: Make the unittests use morphloader This commit removes all use of morph2 from the unittests, replacing it with morphloader/morph3. It also converts the test morphologies to YAML. --- morphlib/source_tests.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'morphlib/source_tests.py') diff --git a/morphlib/source_tests.py b/morphlib/source_tests.py index 6643f0fc..f5ce5d4d 100644 --- a/morphlib/source_tests.py +++ b/morphlib/source_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Codethink Limited +# Copyright (C) 2012-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,10 +22,8 @@ import morphlib class SourceTests(unittest.TestCase): morphology_text = ''' - { - "name": "foo", - "kind": "chunk" - } + name: foo + kind: chunk ''' def setUp(self): @@ -33,7 +31,8 @@ class SourceTests(unittest.TestCase): self.original_ref = 'original/ref' self.sha1 = 'CAFEF00D' self.tree = 'F000000D' - self.morphology = morphlib.morph2.Morphology(self.morphology_text) + loader = morphlib.morphloader.MorphologyLoader() + self.morphology = loader.load_from_string(self.morphology_text) self.filename = 'foo.morph' self.source = morphlib.source.Source( self.repo_name, self.original_ref, self.sha1, self.tree, -- cgit v1.2.1