Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test fix for dynamic creatability condition in Fluent 25.1 #3363

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions tests/test_creatable.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import pytest

from ansys.fluent.core.utils.fluent_version import FluentVersion


@pytest.mark.fluent_version("latest")
def test_creatable(static_mixer_settings_session) -> None:
setup = static_mixer_settings_session.setup
def test_creatable(mixing_elbow_case_data_session) -> None:
solver = mixing_elbow_case_data_session
fluent_version = solver.get_fluent_version()
has_not = (
setup.boundary_conditions.velocity_inlet,
setup.cell_zone_conditions.fluid,
solver.setup.boundary_conditions.velocity_inlet,
solver.setup.cell_zone_conditions.fluid,
)
results = static_mixer_settings_session.results
has = (
results.graphics.contour,
results.graphics.vector,
solver.results.graphics.contour,
solver.results.graphics.vector,
)

for obj in has_not:
assert not hasattr(obj, "create")
assert "create" not in dir(obj)
# creatability condition is dynamic since 25.1
if fluent_version >= FluentVersion.v251:
assert not getattr(obj, "create").is_active()
else:
assert not hasattr(obj, "create")
assert "create" not in dir(obj)

for obj in has:
assert hasattr(obj, "create")
assert "create" in dir(obj)
if fluent_version >= FluentVersion.v251:
assert getattr(obj, "create").is_active()
Loading