summaryrefslogtreecommitdiff
path: root/morphlib/artifact_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 16:49:24 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 16:49:24 +0100
commit105c0dbbd14626a832ebc036c02bc0c9c60e43bc (patch)
tree9e9398e9e4d4bc8da54a63094142f941b881419e /morphlib/artifact_tests.py
parent605e21914f8c9536ff42ca31043b26200dab85e2 (diff)
downloadmorph-105c0dbbd14626a832ebc036c02bc0c9c60e43bc.tar.gz
Remove BuildGraph, compute cache keys based on Artifacts.
With this commit, the ArtifactResolver no longer computes the cache keys when creating Artifact objects. This will have to happen as a post-resolving step (e.g. prior to building or checking whether a local or remote artifact cache has any of the resolved artifacts). The CacheKeyComputer now takes an Artifact object and computes the cache keys using its dependencies. BuildGraph is no longer needed for the CacheKeyComputer unit tests.
Diffstat (limited to 'morphlib/artifact_tests.py')
-rw-r--r--morphlib/artifact_tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/morphlib/artifact_tests.py b/morphlib/artifact_tests.py
index faeef879..5c912cd7 100644
--- a/morphlib/artifact_tests.py
+++ b/morphlib/artifact_tests.py
@@ -27,7 +27,7 @@ class ArtifactTests(unittest.TestCase):
{
"chunk": "chunk",
"kind": "chunk",
- "artifacts": {
+ "chunks": {
"chunk-runtime": [
"usr/bin",
"usr/sbin",
@@ -42,12 +42,11 @@ class ArtifactTests(unittest.TestCase):
''')
self.source = morphlib.source.Source(
'repo', 'ref', 'sha1', morph, 'chunk.morph')
- self.cache_key = 'cachekey'
self.artifact_name = 'chunk-runtime'
self.artifact = morphlib.artifact.Artifact(
- self.source, self.artifact_name, self.cache_key)
+ self.source, self.artifact_name)
self.other = morphlib.artifact.Artifact(
- self.source, self.artifact_name, self.cache_key)
+ self.source, self.artifact_name)
def test_constructor_sets_source(self):
self.assertEqual(self.artifact.source, self.source)
@@ -55,8 +54,8 @@ class ArtifactTests(unittest.TestCase):
def test_constructor_sets_name(self):
self.assertEqual(self.artifact.name, self.artifact_name)
- def test_constructor_sets_cache_key(self):
- self.assertEqual(self.artifact.cache_key, self.cache_key)
+ def test_constructor_initializes_cache_key_as_none(self):
+ self.assertEqual(self.artifact.cache_key, None)
def test_sets_dependencies_to_empty(self):
self.assertEqual(self.artifact.dependencies, [])