From b068b7fa1331a7c6e2ef0632d9566310bfa58b9d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 18 Jul 2012 16:34:56 +0100 Subject: 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. --- morphlib/cachekeycomputer_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'morphlib/cachekeycomputer_tests.py') 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", -- cgit v1.2.1