示例#1
0
    def test_runner_tap_error(self):
        tap_script = """#!/bin/sh
echo '1..2'
echo '# Defining an basic test'
echo 'error - description 1'
echo 'ok 2 - description 2'"""
        tap_path = os.path.join(self.tmpdir.name, 'tap.sh')

        with open(tap_path, 'w', encoding='utf-8') as fp:
            fp.write(tap_script)

        runnable = Runnable('tap', '/bin/sh', tap_path)
        runner = runner_tap.TAPRunner()
        results = [status for status in runner.run(runnable)]
        last_result = results[-1]
        self.assertEqual(last_result['status'], 'finished')
        self.assertEqual(last_result['result'], 'error')
        self.assertEqual(last_result['returncode'], 0)
示例#2
0
    def test_runner_tap_error(self):
        tap_script = """#!/bin/sh
echo '1..2'
echo '# Defining an basic test'
echo 'error - description 1'
echo 'ok 2 - description 2'"""
        tap_path = os.path.join(self.tmpdir.name, "tap.sh")

        with open(tap_path, "w", encoding="utf-8") as fp:
            fp.write(tap_script)

        runnable = Runnable("tap", "/bin/sh", tap_path)
        runner = runner_tap.TAPRunner()
        results = [status for status in runner.run(runnable)]
        last_result = results[-1]
        self.assertEqual(last_result["status"], "finished")
        self.assertEqual(last_result["result"], "error")
        self.assertEqual(last_result["returncode"], 0)