(testcase: DataDrivenTestCase)
| 36 | |
| 37 | |
| 38 | def test_daemon(testcase: DataDrivenTestCase) -> None: |
| 39 | assert testcase.old_cwd is not None, "test was not properly set up" |
| 40 | for i, step in enumerate(parse_script(testcase.input)): |
| 41 | cmd = step[0] |
| 42 | expected_lines = step[1:] |
| 43 | assert cmd.startswith("$") |
| 44 | cmd = cmd[1:].strip() |
| 45 | cmd = cmd.replace("{python}", sys.executable) |
| 46 | sts, output = run_cmd(cmd) |
| 47 | output_lines = output.splitlines() |
| 48 | output_lines = normalize_error_messages(output_lines) |
| 49 | if sts: |
| 50 | output_lines.append("== Return code: %d" % sts) |
| 51 | assert_string_arrays_equal( |
| 52 | expected_lines, |
| 53 | output_lines, |
| 54 | "Command %d (%s) did not give expected output" % (i + 1, cmd), |
| 55 | ) |
| 56 | |
| 57 | |
| 58 | def parse_script(input: list[str]) -> list[list[str]]: |
no test coverage detected
searching dependent graphs…