summaryrefslogtreecommitdiff
path: root/morphlib/sourceresolver_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-06-01 12:53:08 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-06-03 14:57:17 +0000
commiteb3eb4702c59f643dd2369514e5ade0fa7b7174a (patch)
treeb93f359ad2f9238d432470521b6677c5db916518 /morphlib/sourceresolver_tests.py
parente7027e591c4fea5235a33bbe2cda809ddbe6bbf0 (diff)
downloadmorph-eb3eb4702c59f643dd2369514e5ade0fa7b7174a.tar.gz
sourceresolver: Pass build system directly to morphology creation
We cache based on the name, but to get the name we acutally loaded the build system, so it's a waste of effort to cache by the name only to reload it later. Change-Id: Ia77e1c73d27005cd4cc6a3bb5553b44e8dfc75c1
Diffstat (limited to 'morphlib/sourceresolver_tests.py')
-rw-r--r--morphlib/sourceresolver_tests.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/morphlib/sourceresolver_tests.py b/morphlib/sourceresolver_tests.py
index 298dae5d..8af8d262 100644
--- a/morphlib/sourceresolver_tests.py
+++ b/morphlib/sourceresolver_tests.py
@@ -235,26 +235,26 @@ class SourceResolverTests(unittest.TestCase):
def test_autodetects_local_morphology(self):
self.lr.read_file = self.nolocalmorph
self.lr.list_files = self.autotoolsbuildsystem
- name = self.sr._detect_build_system('reponame', 'sha1',
- 'assumed-local.morph')
- self.assertEqual('autotools', name)
+ bs = self.sr._detect_build_system('reponame', 'sha1',
+ 'assumed-local.morph')
+ self.assertEqual('autotools', bs.name)
def test_cache_repo_if_not_in_either_cache(self):
self.lrc.has_repo = self.doesnothaverepo
self.lr.read_file = self.nolocalmorph
self.lr.list_files = self.autotoolsbuildsystem
self.rrc.ls_tree = self.noremoterepo
- name = self.sr._detect_build_system('reponame', 'sha1',
- 'assumed-local.morph')
- self.assertEqual('autotools', name)
+ bs = self.sr._detect_build_system('reponame', 'sha1',
+ 'assumed-local.morph')
+ self.assertEqual('autotools', bs.name)
def test_autodetects_remote_morphology(self):
self.lrc.has_repo = self.doesnothaverepo
self.rrc.cat_file = self.noremotemorph
self.rrc.ls_tree = self.autotoolsbuildsystem
- name = self.sr._detect_build_system('reponame', 'sha1',
- 'assumed-remote.morph')
- self.assertEqual('autotools', name)
+ bs = self.sr._detect_build_system('reponame', 'sha1',
+ 'assumed-remote.morph')
+ self.assertEqual('autotools', bs.name)
def test_returns_none_when_no_local_morph(self):
self.lr.read_file = self.nolocalfile
@@ -293,9 +293,9 @@ class SourceResolverTests(unittest.TestCase):
def test_autodetects_locally_with_no_remote(self):
self.lr.read_file = self.nolocalmorph
self.lr.list_files = self.autotoolsbuildsystem
- name = self.sr._detect_build_system('reponame', 'sha1',
- 'assumed-local.morph')
- self.assertEqual('autotools', name)
+ bs = self.sr._detect_build_system('reponame', 'sha1',
+ 'assumed-local.morph')
+ self.assertEqual('autotools', bs.name)
def test_succeeds_when_local_not_cached_and_no_remote(self):
self.lrc.has_repo = self.doesnothaverepo