diff options
Diffstat (limited to 'morphlib/localartifactcache_tests.py')
-rw-r--r-- | morphlib/localartifactcache_tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/morphlib/localartifactcache_tests.py b/morphlib/localartifactcache_tests.py index 8e25e5c9..36b5e891 100644 --- a/morphlib/localartifactcache_tests.py +++ b/morphlib/localartifactcache_tests.py @@ -142,3 +142,16 @@ class LocalArtifactCacheTests(unittest.TestCase): self.assertEqual(stored_metadata, 'source log line 1\nsource log line 2\n') + + def test_clears_artifact_cache(self): + cache = morphlib.localartifactcache.LocalArtifactCache( + self.tempdir.dirname) + + handle = cache.put(self.runtime_artifact) + handle.write('runtime') + handle.close() + + self.assertTrue(cache.has(self.runtime_artifact)) + cache.clear() + self.assertFalse(cache.has(self.runtime_artifact)) + |