Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 11 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,17 @@ def model_with_ns():

@pytest.fixture()
def fluent_multi_species():
"""Create a data sources with a cas and a dat file of fluent multi-species case."""
ds = core.DataSources()
files = examples.download_fluent_multi_species()
ds.set_result_file_path(files["cas"], "cas")
ds.add_file_path(files["dat"], "dat")
return ds
"""Return a function which creates a data sources
with a cas and a dat file of fluent multi-species case."""

def return_ds(server=None):
ds = core.DataSources(server=server)
files = examples.download_fluent_multi_species(server=server)
ds.set_result_file_path(files["cas"], "cas")
ds.add_file_path(files["dat"], "dat")
return ds

return return_ds


@pytest.fixture()
Expand Down
26 changes: 26 additions & 0 deletions tests/test_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest
import conftest
import platform
from ansys.dpf import core as dpf


@pytest.mark.skipif(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove distinction between in process and grpc, use server_types fixture

not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0 or
platform.system() == "Linux",
reason="CFF source operators where not supported before 7.0,",
)
def test_cff_model_in_process(server_in_process, fluent_multi_species):
ds = fluent_multi_species(server_in_process)
model = dpf.Model(ds, server=server_in_process)
print(model)
assert model is not None

@pytest.mark.skipif(
not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0,
reason="CFF source operators where not supported before 7.0,",
)
def test_cff_model_grpc_servers(server_type, fluent_multi_species):
ds = fluent_multi_species(server_type)
model = dpf.Model(ds, server=server_type)
print(model)
assert model is not None