From ad4aa1b42863763e32a19f5dd50209aeb345b2e0 Mon Sep 17 00:00:00 2001 From: Augusto Finger Pacheco <44980634+fingeraugusto@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:26:59 -0300 Subject: [PATCH] Added test for different app versions (#76) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- tests/test_pyrocky.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/test_pyrocky.py b/tests/test_pyrocky.py index f4fe351c..d65a5e61 100644 --- a/tests/test_pyrocky.py +++ b/tests/test_pyrocky.py @@ -34,8 +34,28 @@ def rocky_session(): rocky.close() -def test_minimal_simulation(rocky_session, tmp_path): +@pytest.mark.parametrize( + "version, expected_version", + [ + ("25.1", 251), + ("24.2", 240), + ], +) +def test_minimal_simulation(version, expected_version, tmp_path, request): + """Minimal test to be run with all the supported Rocky version to ensure + minimal backwards compatibility. + """ + short_v = version.replace(".", "") + exe_file = f"C:\\Program Files\\ANSYS Inc\\v{short_v}\\Rocky\\bin\\Rocky.exe" + pyrocky.launch_rocky(exe_file) rocky = pyrocky.connect_to_rocky() + request.addfinalizer(rocky.close) + + from ansys.rocky.core.client import _ROCKY_VERSION + + global _ROCKY_VERSION + assert _ROCKY_VERSION == expected_version + project = rocky.api.CreateProject() assert project, "No project created"