summaryrefslogtreecommitdiff
path: root/morphlib/sourceresolver_tests.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-20 10:50:35 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-20 13:48:43 +0000
commit9c53c8b12a2ff92e850daf3def87aa489dfafecf (patch)
treec33a1295610ee5de1d8eccc9585bbd69f883a72c /morphlib/sourceresolver_tests.py
parent0b0f6631fc410b281bca45d30bf6f41105b0b0f8 (diff)
downloadmorph-9c53c8b12a2ff92e850daf3def87aa489dfafecf.tar.gz
sourceresolver: Simplify some code paths
It turns out that always looking for the chunk morph in the definitions repo allows us to make the code a little less nasty. Bonus!
Diffstat (limited to 'morphlib/sourceresolver_tests.py')
-rw-r--r--morphlib/sourceresolver_tests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/morphlib/sourceresolver_tests.py b/morphlib/sourceresolver_tests.py
index 6d6a83fa..75025a9a 100644
--- a/morphlib/sourceresolver_tests.py
+++ b/morphlib/sourceresolver_tests.py
@@ -308,10 +308,12 @@ class SourceResolverTests(unittest.TestCase):
'assumed-local.morph')
self.assertEqual('autotools', name)
- def test_fails_when_local_not_cached_and_no_remote(self):
+ def test_succeeds_when_local_not_cached_and_no_remote(self):
self.lrc.has_repo = self.doesnothaverepo
- self.assertRaises(NotcachedError, self.lsr._get_morphology,
- 'reponame', 'sha1', 'unreached.morph')
+ self.lr.list_files = self.localmorph
+ morph = self.sr._get_morphology('reponame', 'sha1',
+ 'chunk.morph')
+ self.assertEqual('chunk', morph['name'])
def test_arch_is_validated(self):
self.lr.arch = 'unknown'