summaryrefslogtreecommitdiff
path: root/morphlib/sourcepool_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 10:52:39 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 13:34:25 +0100
commitad31f7608febab04157e015a90f5047a6f0d8d83 (patch)
tree0ac0885cd6e77783a0251ed67ad03f3834679d00 /morphlib/sourcepool_tests.py
parent48732135d4536880e5459e3064cce9cfa63d6abe (diff)
downloadmorph-ad31f7608febab04157e015a90f5047a6f0d8d83.tar.gz
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.
Diffstat (limited to 'morphlib/sourcepool_tests.py')
-rw-r--r--morphlib/sourcepool_tests.py7
1 files changed, 3 insertions, 4 deletions
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)