Exemplo n.º 1
0
Arquivo: tests.py Projeto: disqus/mule
 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'])
Exemplo n.º 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"])
Exemplo n.º 3
0
Arquivo: tests.py Projeto: disqus/mule
    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'])
Exemplo n.º 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"])