diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-18 16:34:56 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-18 17:29:59 +0100 |
commit | b068b7fa1331a7c6e2ef0632d9566310bfa58b9d (patch) | |
tree | a5ba4624e87860920059cc4a4b931c75a5b5d778 /morphlib/cachekeycomputer_tests.py | |
parent | 0a1c41a539adee00cf4eefa81d4ab8841b65b10f (diff) | |
download | morph-b068b7fa1331a7c6e2ef0632d9566310bfa58b9d.tar.gz |
Have MorphologyFactory set Morphology.builds_artifacts
This way we can have one place in the code where we determine what
artifacts get built from a specific morphology, rather than spreading
the information around the code base.
From now on, everything is supposed to use the builds_artifacts attribute
to get the list of artifacts. ArtifactResolver has been changed to do that.
Some of the tests are now a bit messier, and should really be changed
to create Morphology objects using MorphologyFactory, but that's a change
for another day.
Diffstat (limited to 'morphlib/cachekeycomputer_tests.py')
-rw-r--r-- | morphlib/cachekeycomputer_tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/morphlib/cachekeycomputer_tests.py b/morphlib/cachekeycomputer_tests.py index 82d3e6e5..4847218f 100644 --- a/morphlib/cachekeycomputer_tests.py +++ b/morphlib/cachekeycomputer_tests.py @@ -85,6 +85,14 @@ class CacheKeyComputerTests(unittest.TestCase): source = morphlib.source.Source('repo', 'original/ref', 'sha', morphlib.morph2.Morphology(text), name) self.source_pool.add(source) + # FIXME: This should use MorphologyFactory + m = source.morphology + if m['kind'] == 'system': + m.builds_artifacts = [m['name'] + '-rootfs'] + elif m['kind'] == 'stratum': + m.builds_artifacts = [m['name']] + elif m['kind'] == 'chunk': + m.builds_artifacts = [m['name']] self.build_env = DummyBuildEnvironment({ "USER": "foouser", "USERNAME": "foouser", |