From 0ac7f65b5de6bf55045fa6a0eebe1ee7389a9804 Mon Sep 17 00:00:00 2001 From: ElliottKasoar <45317199+ElliottKasoar@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:29:07 +0100 Subject: [PATCH] Fix submission tests (#167) --- tests/calculations/test_geomopt.py | 12 ++++++++++-- tests/calculations/test_md.py | 17 ++++++++++++++--- tests/calculations/test_singlepoint.py | 12 ++++++++++-- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/tests/calculations/test_geomopt.py b/tests/calculations/test_geomopt.py index b5928ee..bb53361 100644 --- a/tests/calculations/test_geomopt.py +++ b/tests/calculations/test_geomopt.py @@ -94,12 +94,20 @@ def test_run_opt(model_folder, janus_code): assert result["xyz_output"].filename == "aiida-results.xyz" -def test_example_opt(example_path): +def test_example_opt(example_path, janus_code): """Test function to run geometry optimization using the example file provided.""" example_file_path = example_path / "submit_geomopt.py" - command = ["verdi", "run", example_file_path, "janus@localhost"] + command = [ + "verdi", + "run", + example_file_path, + f"{janus_code.label}@{janus_code.computer.label}", + ] # Execute the command result = subprocess.run(command, capture_output=True, text=True, check=False) assert result.stderr == "" assert result.returncode == 0 + assert "results from calculation:" in result.stdout + assert "'traj_file':