summaryrefslogtreecommitdiff
path: root/morphlib/builder2_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-05-29 17:18:46 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-05-30 13:11:13 +0100
commitb088e31b740c62b90ddf9c3342b876736790c1e8 (patch)
treeb73ea9c49d130c584c50c3b8c55f755f5cfa6d4a /morphlib/builder2_tests.py
parent34817d54a193c6c0937ef3868f31d822e90aa740 (diff)
downloadmorph-b088e31b740c62b90ddf9c3342b876736790c1e8.tar.gz
morph: remove dead code and replace Execute with app.runcmd
Diffstat (limited to 'morphlib/builder2_tests.py')
-rw-r--r--morphlib/builder2_tests.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/morphlib/builder2_tests.py b/morphlib/builder2_tests.py
index 93a2f8b7..9730b59e 100644
--- a/morphlib/builder2_tests.py
+++ b/morphlib/builder2_tests.py
@@ -27,6 +27,9 @@ class FakeBuildSystem(object):
def __init__(self):
self.build_commands = ['buildsys-it']
+class FakeApp(object):
+ def __init__(self, runcmd=None):
+ self.runcmd = runcmd
class FakeStagingArea(object):
@@ -43,7 +46,8 @@ class FakeSource(object):
'description': 'c',
}
- self.repo = morphlib.cachedrepo.CachedRepo('repo', 'url', 'path')
+ self.repo = morphlib.cachedrepo.CachedRepo(FakeApp(), 'repo',
+ 'url', 'path')
self.original_ref = 'e'
self.sha1 = 'f'
self.filename = 'g'
@@ -131,13 +135,15 @@ class BuilderBaseTests(unittest.TestCase):
def setUp(self):
self.commands_run = []
+ self.app = FakeApp(self.fake_runcmd)
self.staging_area = FakeStagingArea(self.fake_runcmd)
self.artifact_cache = FakeArtifactCache()
self.artifact = FakeArtifact('le-artifact')
self.repo_cache = None
self.build_env = FakeBuildEnv()
self.max_jobs = 1
- self.builder = morphlib.builder2.BuilderBase(self.staging_area,
+ self.builder = morphlib.builder2.BuilderBase(self.app,
+ self.staging_area,
self.artifact_cache,
None,
self.artifact,
@@ -206,8 +212,10 @@ class BuilderBaseTests(unittest.TestCase):
class ChunkBuilderTests(unittest.TestCase):
def setUp(self):
- self.build = morphlib.builder2.ChunkBuilder(None, None, None, None,
- None, None, 1, False)
+ self.app = FakeApp()
+ self.build = morphlib.builder2.ChunkBuilder(self.app, None, None,
+ None, None, None, None, 1,
+ False)
def test_uses_morphology_commands_when_given(self):
m = { 'build-commands': ['build-it'] }