def test_cmd_stripped_output_and_error_code_0(capsys: Any, cmd: str) -> None: assert repl_invoke(cmd) == 0 captured = capsys.readouterr() slurped = slurp_output_file("linux", cmd) for i in range(len(captured.out)): assert captured.out[i].strip() == slurped[i].strip() assert len(captured.out) == len(slurped)
def test_cmd_output_and_error_code_1(capsys, cmd): assert repl_invoke(cmd) == 1 captured = capsys.readouterr() assert captured.out == slurp_output_file("core", cmd)
def test_cmd_output_and_error_code(capsys: Any, cmd: str) -> None: assert repl_invoke(cmd) == 0 captured = capsys.readouterr() assert captured.out == slurp_output_file("zfs", cmd)