summaryrefslogtreecommitdiff
path: root/morphlib/localartifactcache_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-09-17 15:07:46 +0000
committerRichard Maw <richard.maw@gmail.com>2014-09-19 12:43:26 +0000
commitdea5e91b2e7b109051bff68e15f8f55fe8c950bd (patch)
tree47bbdf8837ff4dd5c379687e99dc61dd95be79b0 /morphlib/localartifactcache_tests.py
parent27ad604d18f0440c1db714f8c22eda5f27bd4c13 (diff)
downloadmorph-dea5e91b2e7b109051bff68e15f8f55fe8c950bd.tar.gz
FIXUP: Fix unit tests after changing to per-source builds
Diffstat (limited to 'morphlib/localartifactcache_tests.py')
-rw-r--r--morphlib/localartifactcache_tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/morphlib/localartifactcache_tests.py b/morphlib/localartifactcache_tests.py
index c1055d05..4325cfbe 100644
--- a/morphlib/localartifactcache_tests.py
+++ b/morphlib/localartifactcache_tests.py
@@ -47,12 +47,11 @@ class LocalArtifactCacheTests(unittest.TestCase):
'chunk.morph', 'sha1',
'tree', morph)
self.source, = sources
+ self.source.cache_key = '0'*64
self.runtime_artifact = morphlib.artifact.Artifact(
self.source, 'chunk-runtime')
- self.runtime_artifact.cache_key = '0'*64
self.devel_artifact = morphlib.artifact.Artifact(
self.source, 'chunk-devel')
- self.devel_artifact.cache_key = '0'*64
def test_artifact_filename(self):
cache = morphlib.localartifactcache.LocalArtifactCache(self.tempfs)
@@ -63,12 +62,13 @@ class LocalArtifactCacheTests(unittest.TestCase):
def test_get_source_metadata_filename(self):
cache = morphlib.localartifactcache.LocalArtifactCache(self.tempfs)
artifact = self.devel_artifact
+ source = self.source
name = 'foobar'
filename = cache.get_source_metadata_filename(artifact.source,
- artifact.cache_key, name)
+ source.cache_key, name)
expected_name = self.tempfs.getsyspath('%s.%s' %
- (artifact.cache_key, name))
+ (source.cache_key, name))
self.assertEqual(filename, expected_name)
def test_put_artifacts_and_check_whether_the_cache_has_them(self):
@@ -167,13 +167,13 @@ class LocalArtifactCacheTests(unittest.TestCase):
handle.write('runtime')
handle.close()
- self.assertTrue(len(list(cache.list_contents())) == 1)
+ self.assertEqual(len(list(cache.list_contents())), 1)
handle = cache.put(self.devel_artifact)
handle.write('devel')
handle.close()
- self.assertTrue(len(list(cache.list_contents())) == 1)
+ self.assertEqual(len(list(cache.list_contents())), 1)
def test_put_artifacts_and_remove_them_afterwards(self):
cache = morphlib.localartifactcache.LocalArtifactCache(self.tempfs)
@@ -189,4 +189,4 @@ class LocalArtifactCacheTests(unittest.TestCase):
key = list(cache.list_contents())[0][0]
cache.remove(key)
- self.assertTrue(len(list(cache.list_contents())) == 0)
+ self.assertEqual(len(list(cache.list_contents())), 0)