Beispiel #1
0
 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'])
Beispiel #2
0
 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"])
Beispiel #3
0
    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'])
Beispiel #4
0
    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"])