From dea5e91b2e7b109051bff68e15f8f55fe8c950bd Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 17 Sep 2014 15:07:46 +0000 Subject: FIXUP: Fix unit tests after changing to per-source builds --- morphlib/localartifactcache_tests.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'morphlib/localartifactcache_tests.py') 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) -- cgit v1.2.1