def test_subprocess(self): result = run_test('build_id', 'echo $TEST', 'job') self.assertTrue('retcode' in result) self.assertTrue('timeStarted' in result) self.assertTrue('timeFinished' in result) self.assertTrue('build_id' in result) self.assertTrue('stdout' in result) self.assertTrue('stderr' in result) self.assertTrue('job' in result) self.assertEquals(result['job'], 'job') self.assertEquals(result['stdout'], 'job') self.assertGreater(result['timeFinished'], result['timeStarted'])
def test_subprocess(self): result = run_test("build_id", "echo $TEST", "job") self.assertTrue("retcode" in result) self.assertTrue("timeStarted" in result) self.assertTrue("timeFinished" in result) self.assertTrue("build_id" in result) self.assertTrue("stdout" in result) self.assertTrue("stderr" in result) self.assertTrue("job" in result) self.assertEquals(result["job"], "job") self.assertEquals(result["stdout"], "job") self.assertGreater(result["timeFinished"], result["timeStarted"])
def test_callback(self): bar = [] def foo(result): bar.append(result) result = run_test('build_id', 'echo $TEST', 'job', foo) self.assertEquals(len(bar), 1) result = bar[0] self.assertTrue('retcode' in result) self.assertTrue('timeStarted' in result) self.assertTrue('timeFinished' in result) self.assertTrue('build_id' in result) self.assertTrue('stdout' in result) self.assertTrue('stderr' in result) self.assertTrue('job' in result) self.assertEquals(result['job'], 'job') self.assertEquals(result['stdout'], 'job') self.assertGreater(result['timeFinished'], result['timeStarted'])
def test_callback(self): bar = [] def foo(result): bar.append(result) result = run_test("build_id", "echo $TEST", "job", foo) self.assertEquals(len(bar), 1) result = bar[0] self.assertTrue("retcode" in result) self.assertTrue("timeStarted" in result) self.assertTrue("timeFinished" in result) self.assertTrue("build_id" in result) self.assertTrue("stdout" in result) self.assertTrue("stderr" in result) self.assertTrue("job" in result) self.assertEquals(result["job"], "job") self.assertEquals(result["stdout"], "job") self.assertGreater(result["timeFinished"], result["timeStarted"])