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/source_tests.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'morphlib/source_tests.py') 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) -- cgit v1.2.1