summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-08-07 11:55:25 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-08-07 13:41:40 +0100
commit66291811c81ed21f5005ba35e68898c73edd88bd (patch)
treea2aefc7e7cb36a73d4c76da349796c3402bbcc20 /morphlib/morphologyfactory_tests.py
parent6c0e0fb41df901771be8074d1e2603ceb26a3926 (diff)
downloadmorph-66291811c81ed21f5005ba35e68898c73edd88bd.tar.gz
morphologyfactory: refactor chunk bdeps exceptions
This creates a small exception hierarchy for failures to validate stratum morphologies. This is currently a line rather than a tree, but it will be expanded later in the patch series. This also adds test coverage for chunk build dependencies being omitted.
Diffstat (limited to 'morphlib/morphologyfactory_tests.py')
-rw-r--r--morphlib/morphologyfactory_tests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/morphlib/morphologyfactory_tests.py b/morphlib/morphologyfactory_tests.py
index b1a6a621..7a3dc343 100644
--- a/morphlib/morphologyfactory_tests.py
+++ b/morphlib/morphologyfactory_tests.py
@@ -59,6 +59,18 @@ class FakeLocalRepo(object):
"name": "stratum",
"kind": "stratum"
}''',
+ 'stratum-no-chunk-bdeps.morph': '''{
+ "name": "stratum-no-chunk-bdeps",
+ "kind": "stratum",
+ "chunks": [
+ {
+ "name": "chunk",
+ "repo": "test:repo",
+ "ref": "sha1",
+ "build-mode": "bootstrap"
+ }
+ ]
+ }''',
'system.morph': '''{
"name": "system",
"kind": "system",
@@ -261,3 +273,8 @@ class MorphologyFactoryTests(unittest.TestCase):
self.assertRaises(morphlib.Error, self.mf.get_morphology,
'reponame', 'sha1', 'parse-error.morph')
+ def test_fails_on_no_chunk_bdeps(self):
+ self.assertRaises(morphlib.morphologyfactory.NoChunkBuildDependsError,
+ self.mf.get_morphology, 'reponame', 'sha1',
+ 'stratum-no-chunk-bdeps.morph')
+