diff --git a/tests/test_orchestration.py b/tests/test_orchestration.py index 59d0613..9e2b419 100644 --- a/tests/test_orchestration.py +++ b/tests/test_orchestration.py @@ -1,4 +1,5 @@ import pytest +import os def test_cadorchestrator_command_line(): """ @@ -15,8 +16,16 @@ def test_cadorchestrator_command_line(): if os.path.exists(build_dir): shutil.rmtree(build_dir) + if "PYTHONPATH" in os.environ: + py_path = os.getcwd() + ":" + os.environ["PYTHONPATH"] + else: + py_path = None + # Run the cadorchestrator with the test configuration file - result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"], env=dict(PATH=os.environ['PATH'] + ":" + os.getcwd())) + if py_path == None: + result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"]) + else: + result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"], env=dict(PYTHONPATH=py_path)) # Make sure that the command ran successfully assert result.returncode == 0