diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-09 18:19:16 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-09 18:19:16 +0100 |
commit | aa47f79da62be1320c0b975edb55054b24448d7f (patch) | |
tree | 7fd0635d714f8967b5205410f8097b3ff533d6a7 /morphlib/localrepocache_tests.py | |
parent | cc9d92874c159b65b248f8f8f7e164aa32416836 (diff) | |
download | morph-aa47f79da62be1320c0b975edb55054b24448d7f.tar.gz |
Remove downloaded bundle after it has been cloned
Diffstat (limited to 'morphlib/localrepocache_tests.py')
-rw-r--r-- | morphlib/localrepocache_tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
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) |