From ad31f7608febab04157e015a90f5047a6f0d8d83 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Wed, 18 Apr 2012 10:52:39 +0100 Subject: Add a repo_name to Source, use that instead of repo in most places. This is because we will need to integrate a RemoteRepoCache and we don't always want to create a CachedRepo object (in fact, we only want that for the sources of artifacts we actually need to build). So we'll use either the local or the remote repo cache to resolve refs and morphology texts and then later, when actually caching a repo, we'll set the source.repo member to a CachedRepo object that we can then use to unpack the sources. --- morphlib/sourcepool_tests.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'morphlib/sourcepool_tests.py') diff --git a/morphlib/sourcepool_tests.py b/morphlib/sourcepool_tests.py index 60f09dfc..9243bb1d 100644 --- a/morphlib/sourcepool_tests.py +++ b/morphlib/sourcepool_tests.py @@ -22,8 +22,7 @@ import morphlib class DummySource(object): def __init__(self): - self.repo = morphlib.cachedrepo.CachedRepo( - 'repo', 'repo url', 'repo path') + self.repo_name = 'repo' self.original_ref = 'original/ref' self.sha1 = 'dummy.sha1' self.filename = 'dummy.morph' @@ -48,7 +47,7 @@ class SourcePoolTests(unittest.TestCase): def test_looks_up_source(self): self.pool.add(self.source) - result = self.pool.lookup(self.source.repo.original_name, + result = self.pool.lookup(self.source.repo_name, self.source.original_ref, self.source.filename) self.assertEqual(result, self.source) @@ -56,7 +55,7 @@ class SourcePoolTests(unittest.TestCase): def test_lookup_raises_keyerror_if_not_found(self): self.assertRaises(KeyError, self.pool.lookup, - self.source.repo.original_name, + self.source.repo_name, self.source.original_ref, self.source.filename) -- cgit v1.2.1