diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-20 16:04:36 +0000 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2012-09-21 15:00:05 +0100 |
commit | 4169d564760ed2ea1acc88e89293ea6a46ec6bb8 (patch) | |
tree | 86561efabe59a2e1ca096d3a765ffa513ad0cbd5 /morphlib/localartifactcache_tests.py | |
parent | dbc7cee2d8c0c307e8805bde876b30f2fac2eb46 (diff) | |
download | morph-4169d564760ed2ea1acc88e89293ea6a46ec6bb8.tar.gz |
Add .artifact_filename() to external API of LocalArtifactCache
This adds a way to access the local disk path of the artifact
for an artifact. This is necessary to be able to report it to
the user.
Diffstat (limited to 'morphlib/localartifactcache_tests.py')
-rw-r--r-- | morphlib/localartifactcache_tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/localartifactcache_tests.py b/morphlib/localartifactcache_tests.py index c3deb9dc..8e25e5c9 100644 --- a/morphlib/localartifactcache_tests.py +++ b/morphlib/localartifactcache_tests.py @@ -15,6 +15,7 @@ import unittest +import os import morphlib @@ -52,6 +53,14 @@ class LocalArtifactCacheTests(unittest.TestCase): def tearDown(self): self.tempdir.remove() + def test_artifact_filename(self): + cache = morphlib.localartifactcache.LocalArtifactCache( + self.tempdir.dirname) + filename = cache.artifact_filename(self.devel_artifact) + expected_name = os.path.join(self.tempdir.dirname, + self.devel_artifact.basename()) + self.assertEqual(filename, expected_name) + def test_put_artifacts_and_check_whether_the_cache_has_them(self): cache = morphlib.localartifactcache.LocalArtifactCache( self.tempdir.dirname) |