diff options
Diffstat (limited to 'morphlib/localrepocache_tests.py')
-rw-r--r-- | morphlib/localrepocache_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py index 3cc4f07f..ab6e71fd 100644 --- a/morphlib/localrepocache_tests.py +++ b/morphlib/localrepocache_tests.py @@ -22,6 +22,7 @@ import cliapp import fs.memoryfs import morphlib +import morphlib.gitdir_tests class FakeApplication(object): @@ -56,6 +57,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc._git = self.fake_git self.lrc._fetch = self.not_found self.lrc._mkdtemp = self.fake_mkdtemp + self.lrc._new_cached_repo_instance = self.new_cached_repo_instance self._mkdtemp_count = 0 def fake_git(self, args, **kwargs): @@ -86,6 +88,11 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc.fs.makedir(dirname+"/"+thing) return thing + def new_cached_repo_instance(self, *args): + with morphlib.gitdir_tests.allow_nonexistant_git_repos(): + return morphlib.cachedrepo.CachedRepo( + FakeApplication(), *args) + def not_found(self, url, path): raise cliapp.AppException('Not found') |