diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-01-29 13:50:46 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-01-29 14:32:49 +0000 |
commit | e06eafcbf0784271f51c0936852d1e97c0ccce8b (patch) | |
tree | e7e914cd82348e79b7662e6bd06851a0100e7751 /morphlib/morph2_tests.py | |
parent | 63f608d7c05095c16d1a8863b13c55634c0cae8b (diff) | |
download | morph-e06eafcbf0784271f51c0936852d1e97c0ccce8b.tar.gz |
Make yaml be an optional dependency
This can go away when we have made a release with yaml in it, and its
staging filler.
Diffstat (limited to 'morphlib/morph2_tests.py')
-rw-r--r-- | morphlib/morph2_tests.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py index 34df4657..7a819556 100644 --- a/morphlib/morph2_tests.py +++ b/morphlib/morph2_tests.py @@ -17,6 +17,7 @@ import StringIO import unittest +import morphlib from morphlib.morph2 import Morphology @@ -41,22 +42,23 @@ class MorphologyTests(unittest.TestCase): self.assertEqual(m['max-jobs'], None) self.assertEqual(m['chunks'], []) - def test_parses_simple_yaml_chunk(self): - m = Morphology(''' - name: foo - kind: chunk - build-system: manual - ''') - - self.assertEqual(m['name'], 'foo') - self.assertEqual(m['kind'], 'chunk') - self.assertEqual(m['build-system'], 'manual') - self.assertEqual(m['configure-commands'], None) - self.assertEqual(m['build-commands'], None) - self.assertEqual(m['test-commands'], None) - self.assertEqual(m['install-commands'], None) - self.assertEqual(m['max-jobs'], None) - self.assertEqual(m['chunks'], []) + if morphlib.got_yaml: + def test_parses_simple_yaml_chunk(self): + m = Morphology(''' + name: foo + kind: chunk + build-system: manual + ''') + + self.assertEqual(m['name'], 'foo') + self.assertEqual(m['kind'], 'chunk') + self.assertEqual(m['build-system'], 'manual') + self.assertEqual(m['configure-commands'], None) + self.assertEqual(m['build-commands'], None) + self.assertEqual(m['test-commands'], None) + self.assertEqual(m['install-commands'], None) + self.assertEqual(m['max-jobs'], None) + self.assertEqual(m['chunks'], []) def test_sets_stratum_chunks_repo_and_morph_from_name(self): m = Morphology(''' |