Skip to content

Commit

Permalink
Added test for different app versions (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fingeraugusto and pre-commit-ci[bot] authored Jul 11, 2024
1 parent 02d227b commit ad4aa1b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/test_pyrocky.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit ad4aa1b

Please sign in to comment.