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

test print non utf8 char #1667

Merged
merged 1 commit into from
Aug 1, 2024
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
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ def return_ds(server=None):

return return_ds

SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1 = meets_version(
get_server_version(core._global_server()), "9.1"
)
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_2 = meets_version(
get_server_version(core._global_server()), "8.2"
)
Expand Down
20 changes: 15 additions & 5 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_loadplugin(server_type):
@pytest.mark.skipif(
platform.system() == "Windows"
and (
platform.python_version().startswith("3.8") or platform.python_version().startswith("3.7")
platform.python_version().startswith("3.8") or platform.python_version().startswith("3.7")
),
reason="Random SEGFAULT in the GitHub pipeline for 3.7-8 on Windows",
)
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_upload_download(tmpdir, server_type_remote_process):

@pytest.mark.skipif(running_docker, reason="Path hidden within docker container")
def test_download_folder(
allkindofcomplexity, plate_msup, multishells, tmpdir, server_type_remote_process
allkindofcomplexity, plate_msup, multishells, tmpdir, server_type_remote_process
):
tmpdir = str(tmpdir)
file = dpf.core.upload_file_in_tmp_folder(
Expand Down Expand Up @@ -465,8 +465,8 @@ def test_context_environment_variable(reset_context_environment_variable):
# Test raise on wrong value
os.environ[key] = "PREM"
with pytest.warns(
UserWarning,
match="which is not recognized as an available " "DPF ServerContext type.",
UserWarning,
match="which is not recognized as an available " "DPF ServerContext type.",
):
reload(s_c)
assert s_c.SERVER_CONTEXT == s_c.AvailableServerContexts.premium
Expand Down Expand Up @@ -537,7 +537,7 @@ def test_license_context_manager_as_context(server_type):
op.inputs.field(field)
op.inputs.threshold(0.0)
with dpf.core.LicenseContextManager(
increment_name="ansys", license_timeout_in_seconds=1.0, server=server_type
increment_name="ansys", license_timeout_in_seconds=1.0, server=server_type
) as lic:
out = op.outputs.field()
st = lic.status
Expand All @@ -546,5 +546,15 @@ def test_license_context_manager_as_context(server_type):
assert "ansys" not in st


@pytest.mark.skipif(
not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1,
reason="Bug"
)
def test_print_non_utf8_string():
op = dpf.core.Operator("generate_uuid")
out_str = op.get_output(0, dpf.core.types.string)
assert len(str(out_str)) > 0


if __name__ == "__main__":
test_load_api_with_awp_root()
Loading