diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-08-08 08:36:34 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-08-14 13:28:50 +0000 |
commit | 95c5f93d554883fdedaeb3e111e1be9f88e0045c (patch) | |
tree | 27891ef793481fdea9cfa6dbf94c907309bb1a18 /morphlib/morphloader_tests.py | |
parent | e15c4fd713ee4222ebd0a0c1740e6fb91e15cbad (diff) | |
download | morph-95c5f93d554883fdedaeb3e111e1be9f88e0045c.tar.gz |
morphloader: Add and remove some default values
This commit stops morphloader setting the `morph` field in chunk specs,
and also makes it set defaults for the prefix and build-mode fields. Not
setting the `morph` field is necessary as its presence in chunk specs is
used by `traverse_morphs` to mean that the morphology file is in the
definitions repository, not the chunk source repository. If we set a
default value here, we end up looking for files which do not exist.
Diffstat (limited to 'morphlib/morphloader_tests.py')
-rw-r--r-- | morphlib/morphloader_tests.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/morphlib/morphloader_tests.py b/morphlib/morphloader_tests.py index f4d2f9b6..738f1c32 100644 --- a/morphlib/morphloader_tests.py +++ b/morphlib/morphloader_tests.py @@ -569,6 +569,7 @@ build-system: dummy 'name': 'foo', 'description': '', 'build-system': 'manual', + 'build-mode': 'staging', 'configure-commands': [], 'pre-configure-commands': [], @@ -589,6 +590,7 @@ build-system: dummy 'products': [], 'devices': [], 'max-jobs': None, + 'prefix': '/usr', }) def test_unsets_defaults_for_chunks(self): @@ -637,6 +639,7 @@ build-system: dummy "morph": "bar", 'build-mode': 'bootstrap', 'build-depends': [], + 'prefix': '/usr', }, ], 'products': [], @@ -650,8 +653,9 @@ build-system: dummy { 'name': 'bar', "ref": "bar", - 'build-mode': 'bootstrap', + 'build-mode': 'staging', 'build-depends': [], + 'prefix': '/usr', }, ], } @@ -754,7 +758,7 @@ build-system: dummy [{'morph': 'foo'}, {'morph': 'bar'}]) - def test_sets_stratum_chunks_repo_and_morph_from_name(self): + def test_sets_stratum_chunks_repo_from_name(self): m = morphlib.morph3.Morphology( { "name": "foo", @@ -771,9 +775,8 @@ build-system: dummy self.loader.set_defaults(m) self.loader.validate(m) self.assertEqual(m['chunks'][0]['repo'], 'le-chunk') - self.assertEqual(m['chunks'][0]['morph'], 'le-chunk') - def test_collapses_stratum_chunks_repo_and_morph_from_name(self): + def test_collapses_stratum_chunks_repo_from_name(self): m = morphlib.morph3.Morphology( { "name": "foo", @@ -791,7 +794,6 @@ build-system: dummy self.loader.unset_defaults(m) self.assertTrue('repo' not in m['chunks'][0]) - self.assertTrue('morph' not in m['chunks'][0]) def test_convertes_max_jobs_to_an_integer(self): m = morphlib.morph3.Morphology( |