summaryrefslogtreecommitdiff
path: root/morphlib/source_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/source_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/source_tests.py')
-rw-r--r--morphlib/source_tests.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/morphlib/source_tests.py b/morphlib/source_tests.py
index 3a396c63..a539da29 100644
--- a/morphlib/source_tests.py
+++ b/morphlib/source_tests.py
@@ -29,20 +29,23 @@ class SourceTests(unittest.TestCase):
'''
def setUp(self):
- self.repo = 'foo.repo'
+ self.repo_name = 'foo.repo'
self.original_ref = 'original/ref'
self.sha1 = 'CAFEF00D'
self.morphology = morphlib.morph2.Morphology(self.morphology_text)
self.filename = 'foo.morph'
- self.source = morphlib.source.Source(self.repo, self.original_ref,
- self.sha1, self.morphology,
- self.filename)
- self.other = morphlib.source.Source(self.repo, self.original_ref,
- self.sha1, self.morphology,
- self.filename)
+ self.source = morphlib.source.Source(
+ self.repo_name,self.original_ref, self.sha1, self.morphology,
+ self.filename)
+ self.other = morphlib.source.Source(
+ self.repo_name, self.original_ref, self.sha1, self.morphology,
+ self.filename)
- def test_sets_repo(self):
- self.assertEqual(self.source.repo, self.repo)
+ def test_sets_repo_name(self):
+ self.assertEqual(self.source.repo_name, self.repo_name)
+
+ def test_sets_repo_to_none_initially(self):
+ self.assertEqual(self.source.repo, None)
def test_sets_original_ref(self):
self.assertEqual(self.source.original_ref, self.original_ref)