From d4f9f0215874a021fc8a33ade69f1955839559c0 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Wed, 14 May 2014 12:23:13 +0100 Subject: Add test for get_source_metadata_filename --- morphlib/localartifactcache_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/morphlib/localartifactcache_tests.py b/morphlib/localartifactcache_tests.py index 18d20612..f400a645 100644 --- a/morphlib/localartifactcache_tests.py +++ b/morphlib/localartifactcache_tests.py @@ -60,6 +60,17 @@ class LocalArtifactCacheTests(unittest.TestCase): expected_name = self.tempfs.getsyspath(self.devel_artifact.basename()) self.assertEqual(filename, expected_name) + def test_get_source_metadata_filename(self): + cache = morphlib.localartifactcache.LocalArtifactCache(self.tempfs) + artifact = self.devel_artifact + name = 'foobar' + + filename = cache.get_source_metadata_filename(artifact.source, + artifact.cache_key, name) + expected_name = self.tempfs.getsyspath('%s.%s' % + (artifact.cache_key, name)) + self.assertEqual(filename, expected_name) + def test_put_artifacts_and_check_whether_the_cache_has_them(self): cache = morphlib.localartifactcache.LocalArtifactCache(self.tempfs) -- cgit v1.2.1