Skip to content

Commit e376ef1

Browse files
PProfizirafacanton
andauthored
test: add tests for CFF flprj files (#2640)
Co-authored-by: Rafael Canton <rafael.canton@ansys.com> Co-authored-by: Rafael Canton <107186344+rafacanton@users.noreply.github.com>
1 parent 5886bb2 commit e376ef1

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,20 @@ def return_ds(server=None):
254254
return return_ds
255255

256256

257+
@pytest.fixture()
258+
def fluent_axial_comp_flprj():
259+
"""Return a function which creates a data sources
260+
with a 'flrpj' file of fluent axial compressor case."""
261+
262+
def return_ds(server=None):
263+
ds = core.DataSources(server=server)
264+
files = examples.download_fluent_axial_comp(server=server)
265+
ds.set_result_file_path(files["flprj"], "flprj")
266+
return ds
267+
268+
return return_ds
269+
270+
257271
@pytest.fixture()
258272
def fluent_mixing_elbow_steady_state():
259273
"""Return a function which creates a data sources

tests/test_cff.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ def test_cff_model(server_type, fluent_multi_species):
3939
assert "faces" in str(mesh)
4040

4141

42+
@pytest.mark.skipif(
43+
not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0,
44+
reason="Bug due to gatebin incompatibilities for servers <26.1",
45+
)
46+
def test_cff_model_flprj(server_type, fluent_axial_comp_flprj):
47+
ds = fluent_axial_comp_flprj(server_type)
48+
model = dpf.Model(ds, server=server_type)
49+
assert model is not None
50+
assert "fluid" in str(model)
51+
mesh_info = model.metadata.mesh_info
52+
assert "faces" in str(mesh_info)
53+
54+
4255
@pytest.mark.skipif(
4356
not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0,
4457
reason="CFF source operators where not supported before 7.0,",

0 commit comments

Comments
 (0)