Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _load_result_info(self):
result_info = op.get_output(0, types.result_info)
except Exception as e:
# give the user a more helpful error
if "results file is not defined in the Data sources" in e.args():
if "results file is not defined in the Data sources" in e.args:
raise RuntimeError("Unable to open result file") from None
else:
raise e
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def cyclic_multistage():
return examples.download_multi_stage_cyclic_result()


SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2 = meets_version(
get_server_version(core._global_server()), "6.2"
)
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_1 = meets_version(
get_server_version(core._global_server()), "6.1"
)
Expand Down
15 changes: 13 additions & 2 deletions tests/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_3_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_4_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2,
)

# Check for ANSYS installation env var
Expand Down Expand Up @@ -1233,7 +1234,12 @@ def test_operator_config_specification_simple(server_type):
spec = Specification(operator_name="add", server=server_type)
conf_spec = spec.config_specification
if server_type.os != "posix":
assert "enum dataProcessing::EBinaryOperation" in conf_spec["binary_operation"].type_names
assert (
"enum dataProcessing::EBinaryOperation"
or "binary_operation_enum" in conf_spec["binary_operation"].type_names
)
elif SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2:
assert "binary_operation_enum" in conf_spec["binary_operation"].type_names
assert conf_spec["binary_operation"].default_value_str == "1"
assert "Intersection" in conf_spec["binary_operation"].document
assert "run_in_parallel" in conf_spec
Expand All @@ -1246,7 +1252,12 @@ def test_generated_operator_config_specification_simple(server_type):
spec = op.specification
conf_spec = spec.config_specification
if server_type.os != "posix":
assert "enum dataProcessing::EBinaryOperation" in conf_spec["binary_operation"].type_names
assert (
"enum dataProcessing::EBinaryOperation"
or "binary_operation_enum" in conf_spec["binary_operation"].type_names
)
elif SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2:
assert "binary_operation_enum" in conf_spec["binary_operation"].type_names
assert conf_spec["binary_operation"].default_value_str == "1"
assert "Intersection" in conf_spec["binary_operation"].document
assert "run_in_parallel" in conf_spec
Expand Down