summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-05-04 14:55:13 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-05-04 14:55:13 +0000
commitf3b377ab6ba580dc5eda28b3e53024b841226bd0 (patch)
treee50c201013c2bc787ed32af29adaad448c1f5056 /morphlib/localrepocache_tests.py
parent1bae1c3f268ddc80e5466ff714ae1b5873754c47 (diff)
downloadmorph-f3b377ab6ba580dc5eda28b3e53024b841226bd0.tar.gz
Change LocalRepoCache to use the new RepoAliasResolver.
Diffstat (limited to 'morphlib/localrepocache_tests.py')
-rw-r--r--morphlib/localrepocache_tests.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py
index 176becc7..47f92a1d 100644
--- a/morphlib/localrepocache_tests.py
+++ b/morphlib/localrepocache_tests.py
@@ -24,10 +24,10 @@ class LocalRepoCacheTests(unittest.TestCase):
def setUp(self):
aliases = ['upstream=git://example.com/#example.com:%s.git']
+ repo_resolver = morphlib.repoaliasresolver.RepoAliasResolver(aliases)
bundle_base_url = 'http://lorry.example.com/bundles/'
self.reponame = 'upstream:reponame'
self.repourl = 'git://example.com/reponame'
- self.pushurl = 'example.com:reponame.git'
escaped_url = 'git___example_com_reponame'
self.bundle_url = '%s%s.bndl' % (bundle_base_url, escaped_url)
self.cachedir = '/cache/dir'
@@ -36,9 +36,8 @@ class LocalRepoCacheTests(unittest.TestCase):
self.remotes = {}
self.fetched = []
self.removed = []
- self.lrc = morphlib.localrepocache.LocalRepoCache(self.cachedir,
- aliases,
- bundle_base_url)
+ self.lrc = morphlib.localrepocache.LocalRepoCache(
+ self.cachedir, repo_resolver, bundle_base_url)
self.lrc._git = self.fake_git
self.lrc._exists = self.fake_exists
self.lrc._fetch = self.not_found
@@ -78,18 +77,6 @@ class LocalRepoCacheTests(unittest.TestCase):
self.cache.add(path)
return True
- def test_expands_shortened_url_correctly_for_pulling(self):
- self.assertEqual(self.lrc.pull_url(self.reponame), self.repourl)
-
- def test_expands_shortened_url_correctly_for_pushing(self):
- self.assertEqual(self.lrc.push_url(self.reponame), self.pushurl)
-
- def test_expands_full_url_correctly_for_pulling(self):
- self.assertEqual(self.lrc.pull_url(self.repourl), self.repourl)
-
- def test_expands_full_url_correctly_for_pushing(self):
- self.assertEqual(self.lrc.push_url(self.pushurl), self.pushurl)
-
def test_has_not_got_shortened_repo_initially(self):
self.assertFalse(self.lrc.has_repo(self.reponame))