From aa47f79da62be1320c0b975edb55054b24448d7f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 9 Apr 2012 18:19:16 +0100 Subject: Remove downloaded bundle after it has been cloned --- morphlib/localrepocache_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'morphlib/localrepocache_tests.py') diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py index add0aa20..66a0a3e5 100644 --- a/morphlib/localrepocache_tests.py +++ b/morphlib/localrepocache_tests.py @@ -33,12 +33,14 @@ class LocalRepoCacheTests(unittest.TestCase): self.cache = set() self.remotes = [] self.fetched = [] + self.removed = [] self.lrc = morphlib.localrepocache.LocalRepoCache(self.cachedir, baseurls, bundle_base_url) self.lrc._git = self.fake_git self.lrc._exists = self.fake_exists self.lrc._fetch = self.not_found + self.lrc._remove = self.fake_remove def fake_git(self, args): if args[0] == 'clone': @@ -55,6 +57,9 @@ class LocalRepoCacheTests(unittest.TestCase): def fake_exists(self, filename): return filename in self.cache + def fake_remove(self, filename): + self.removed.append(filename) + def not_found(self, url, path): return False @@ -98,6 +103,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc.cache_repo(self.repourl) self.assertEqual(self.fetched, [self.bundle_url]) self.assertEqual(self.remotes, [self.cache_path + '.bundle']) + self.assertEqual(self.removed, [self.cache_path + '.bundle']) def test_gets_cached_relative_repo(self): self.lrc.cache_repo(self.reponame) -- cgit v1.2.1