diff --git a/tests/test_pytest_abra.py b/tests/test_pytest_abra.py index 0bc03d8..baed132 100644 --- a/tests/test_pytest_abra.py +++ b/tests/test_pytest_abra.py @@ -3,6 +3,7 @@ from pathlib import Path import pytest +from pytest_abra import DirManager from pytest_abra.utils import load_json_to_environ @@ -33,8 +34,8 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path): # ----------------------------------- dirs ----------------------------------- # RECIPES_DIR = Path("../recipes").resolve() - OUTPUT_DIR = Path("./test-output").resolve() - # OUTPUT_DIR = session_tmp_path_testout.resolve() + # OUTPUT_DIR = Path("./test-output").resolve() + OUTPUT_DIR = session_tmp_path_testout.resolve() # ------------------------------------ run ----------------------------------- # @@ -47,27 +48,17 @@ def test_abratest_cli_full_integration(session_tmp_path_testout: Path): RECIPES_DIR, "--output_dir", OUTPUT_DIR, - ], - capture_output=True, + "--session_id", + "abc", + ] ) - with open(OUTPUT_DIR / "tempfile_stdout.txt", "w") as f: - f.write(str(result.stdout)) - with open(OUTPUT_DIR / "tempfile_stderr.txt", "w") as f: - f.write(str(result.stderr)) +@pytest.mark.slow +def test_results_abra(session_tmp_path_testout: Path): + OUTPUT_DIR = session_tmp_path_testout.resolve() - # print(result) - - assert result.returncode == 0 - - assert "failed" not in str(result.stdout) - - # assert False - - -# @pytest.mark.slow -# def test_results_abra(session_tmp_path_testout: Path): -# OUTPUT_DIR = Path("./test-output").resolve() -# print(list(OUTPUT_DIR.rglob("*"))) -# assert False + DIR = DirManager(output_dir=OUTPUT_DIR, session_id="abc") + all_files = list(DIR.STATUS.rglob("*")) + passed_files = list(DIR.STATUS.rglob("passed-*")) + assert len(all_files) == len(passed_files)