def test_run_noFile(self): """ If a file does not exit, fail with FILE_NOT_FOUND """ b = FileBuild('hey') b.version = 'foo' def cb(build): self.assertEqual(build, b) self.assertEqual(build.status, FILE_NOT_FOUND) b.done.addCallback(cb) b.run() return b.done
def test_version_passed(self): """ The version should be passed to the underlying script """ f = FilePath(self.mktemp()) f.setContent('#!/bin/bash\nexit $1') b = FileBuild(f) b.version = '22' def cb(build): self.assertEqual(build, b) self.assertEqual(build.status, 22) b.done.addCallback(cb) b.run() return b.done
def test_run(self): """ Running should execute the given file. """ f = FilePath(self.mktemp()) f.setContent('#!/bin/bash\nexit 12') b = FileBuild(f) b.version = 'foo' def cb(build): self.assertEqual(build, b) self.assertEqual(build.status, 12) b.done.addCallback(cb) b.run() return b.done