diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-11 13:15:31 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-11 13:42:57 +0100 |
commit | 5afd3d7ce64b762acb228f7f6b4f0326d030807b (patch) | |
tree | 75996c6ca35f742fdec74e300bce2662c3c7abcf /morphlib/source_tests.py | |
parent | d1f60363d74a579ee8eee22e0b03494d63dee830 (diff) | |
download | morph-5afd3d7ce64b762acb228f7f6b4f0326d030807b.tar.gz |
Add original_ref member to Source. Default to None for build-depends.
We will almost always want to look up sources based on the data we find
in morphologies (e.g. chunk sources found in a stratum or strata found
in a system). For that we need to remember the original_ref in addition
to the resolved SHA1 and look up sources using this original ref. The
original ref is therefore also used as part of the hash key in
SourcePool now.
Diffstat (limited to 'morphlib/source_tests.py')
-rw-r--r-- | morphlib/source_tests.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/morphlib/source_tests.py b/morphlib/source_tests.py index f9999ca0..3a396c63 100644 --- a/morphlib/source_tests.py +++ b/morphlib/source_tests.py @@ -30,17 +30,23 @@ class SourceTests(unittest.TestCase): def setUp(self): self.repo = '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.sha1, - self.morphology, self.filename) - self.other = morphlib.source.Source(self.repo, self.sha1, - self.morphology, self.filename) + 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) def test_sets_repo(self): self.assertEqual(self.source.repo, self.repo) + def test_sets_original_ref(self): + self.assertEqual(self.source.original_ref, self.original_ref) + def test_sets_sha1(self): self.assertEqual(self.source.sha1, self.sha1) |