Skip to content

Commit ee29bd9

Browse files
committed
Add test and fix docstring
1 parent d5bfed4 commit ee29bd9

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

src/ansys/dpf/core/server_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def xml_path(self, xml_path: str | os.PathLike):
281281
282282
>>> import ansys.dpf.core as dpf
283283
>>> # Create a custom server context
284-
>>> custom_server_context = dpf.AvailableServerContexts.custom_defined
284+
>>> custom_server_context = dpf.AvailableServerContexts.no_context
285285
>>> # Set the XML path
286286
>>> custom_server_context.xml_path = r'\path\to\file'
287287
>>> # Start a DPF server using this context

tests/test_server.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ def test_server_plugins(self, server_config):
180180
assert "native" in server_plugins.keys()
181181

182182

183+
@raises_for_servers_version_under("7.0")
184+
def test_server_plugins(remote_config_server_type, testfiles_dir):
185+
from pathlib import Path
186+
187+
context = dpf.core.AvailableServerContexts.no_context
188+
context.xml_path = Path(testfiles_dir) / "DpfCustomDefinedTest.xml"
189+
server_plugins = start_local_server(config=remote_config_server_type, context=context).plugins
190+
assert sorted(list(server_plugins.keys())) == ["grpc", "native"]
191+
192+
183193
@pytest.mark.skipif(
184194
os.name == "posix" or running_docker,
185195
reason="lin issue: 2 processes can be run with same port",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0"?>
2+
<Dpf version="1.0">
3+
<DefaultPlugins>
4+
<Linux>
5+
<grpc>
6+
<Path>$(ANSYS_ROOT_FOLDER)/dpf/bin/linx64/libAns.Dpf.Grpc.so</Path>
7+
<Loader>LoadOperators</Loader>
8+
</grpc>
9+
<native>
10+
<Path>$(ANSYS_ROOT_FOLDER)/dpf/bin/linx64/libAns.Dpf.Native.so</Path>
11+
<Loader>LoadOperators</Loader>
12+
</native>
13+
</Linux>
14+
<Windows>
15+
<grpc>
16+
<Path>$(ANSYS_ROOT_FOLDER)\dpf\bin\winx64\Ans.Dpf.Grpc.dll</Path>
17+
<Loader>LoadOperators</Loader>
18+
</grpc>
19+
<native>
20+
<Path>$(ANSYS_ROOT_FOLDER)\dpf\bin\winx64\Ans.Dpf.Native.dll</Path>
21+
<Loader>LoadOperators</Loader>
22+
</native>
23+
</Windows>
24+
</DefaultPlugins>
25+
<SearchPath>
26+
<Linux>
27+
<Path>$(ANSYS_ROOT_FOLDER)/dpf/bin/linx64</Path>
28+
</Linux>
29+
<Windows>
30+
<Debug>
31+
<Path>$(ANSYS_ROOT_FOLDER)\dpf\bin\winx64</Path>
32+
</Debug>
33+
<Release>
34+
<Path>$(ANSYS_ROOT_FOLDER)\dpf\bin\winx64</Path>
35+
</Release>
36+
</Windows>
37+
</SearchPath>
38+
<Environment>
39+
<Windows>
40+
<ANSYS_DPF_ACCEPT_LA>Y</ANSYS_DPF_ACCEPT_LA>
41+
</Windows>
42+
<Linux>
43+
<ANSYS_DPF_ACCEPT_LA>Y</ANSYS_DPF_ACCEPT_LA>
44+
</Linux>
45+
</Environment>
46+
</Dpf>

0 commit comments

Comments
 (0)