Skip to content

Commit 8816d68

Browse files
authored
test_layer: changed material for unit tests for add_potting_region when connected to Sherlock (#153)
1 parent 71c1601 commit 8816d68

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

doc/source/api/launcher.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ The ``launcher`` module launches the Sherlock gRPC server and a Sherlock client.
1212
:toctree: _autosummary
1313

1414
ansys.sherlock.core.launcher.launch_sherlock
15+
ansys.sherlock.core.launcher.connect_grpc_channel
16+

src/ansys/sherlock/core/analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ def run_strain_map_analysis(
12651265
strain_map_analyses : list
12661266
List of analyses consisting of these properties:
12671267
1268-
- analysis_type : RunStrainMapAnalysisRequest.StrainMapAnalysis.AnalysisType
1268+
- analysis_type : RunStrainMapAnalysisRequestAnalysisType
12691269
Type of analysis to run.
12701270
- event_strain_maps : list
12711271
List of the strain maps assigned to the desired life cycle events for
@@ -1296,7 +1296,7 @@ def run_strain_map_analysis(
12961296
"AssemblyTutorial",
12971297
"Main Board",
12981298
[[
1299-
analysis_request.StrainMapAnalysis.AnalysisType.RandomVibe,
1299+
RunStrainMapAnalysisRequestAnalysisType.RANDOM_VIBE,
13001300
[["Phase 1", "Random Vibe", "TOP", "MainBoardStrain - Top"],
13011301
["Phase 1", "Random Vibe", "BOTTOM", "MainBoardStrain - Bottom"],
13021302
["Phase 1", "Random Vibe", "TOP", "MemoryCard1Strain", "Memory Card 1"]],

src/ansys/sherlock/core/launcher.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ def launch_sherlock(
4242
IP address to start gRPC on. The default is ``"127.0.0.1"``, which
4343
is the IP address for the local host.
4444
port : int, optional
45-
Port number for the connection. If no port is specified, ``9090``
46-
is used.
45+
Port number for the connection.
4746
single_project_path : str, optional
4847
Path to the Sherlock project if invoking Sherlock in the single-project mode.
49-
The default is ``""``.
5048
sherlock_cmd_args : str, optional
51-
Additional command arguments for launching Sherlock. The default is ``""``.
49+
Additional command arguments for launching Sherlock.
5250
5351
Returns
5452
-------
@@ -75,7 +73,7 @@ def launch_sherlock(
7573
return None
7674

7775
try:
78-
args = _get_sherlock_exe_path() + " " + "-grpcPort=" + str(port)
76+
args = _get_sherlock_exe_path() + " -grpcPort=" + str(port)
7977
if single_project_path != "":
8078
args = f'{args} -singleProject "{single_project_path}"'
8179
if sherlock_cmd_args != "":
@@ -108,9 +106,16 @@ def launch_sherlock(
108106

109107

110108
def connect_grpc_channel(port=SHERLOCK_DEFAULT_PORT):
111-
"""Create a gRPC connection to a specified port and return the ``sherlock``connection object.
109+
"""Create a gRPC connection to a specified port and return the ``Sherlock`` connection object.
112110
113-
The ``sherlock``connection object is used to invoke the APIs from their respective services.
111+
The ``Sherlock`` connection object is used to invoke the APIs from their respective services.
112+
This can be used to connect to the Sherlock instance that is already running with the specified
113+
port.
114+
115+
Parameters
116+
----------
117+
port : int, optional
118+
Port number for the connection.
114119
115120
Returns
116121
-------

tests/test_layer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def helper_test_add_potting_region(layer):
3333
"cca_name": "Main Board",
3434
"potting_id": "Test Region",
3535
"side": "TOP",
36-
"material": "epoxyencapsulant",
36+
"material": "COPPER",
3737
"potting_units": "in",
3838
"thickness": 0.1,
3939
"standoff": 0.2,
@@ -74,7 +74,7 @@ def helper_test_add_potting_region(layer):
7474
{
7575
"potting_id": "Test Region",
7676
"side": "TOP",
77-
"material": "epoxyencapsulant",
77+
"material": "COPPER",
7878
"potting_units": "in",
7979
"thickness": 0.1,
8080
"standoff": 0.2,
@@ -95,7 +95,7 @@ def helper_test_add_potting_region(layer):
9595
"cca_name": "",
9696
"potting_id": "Test Region",
9797
"side": "TOP",
98-
"material": "epoxyencapsulant",
98+
"material": "COPPER",
9999
"potting_units": "in",
100100
"thickness": 0.1,
101101
"standoff": 0.2,
@@ -115,7 +115,7 @@ def helper_test_add_potting_region(layer):
115115
"cca_name": "Test Card",
116116
"potting_id": "Test Region",
117117
"side": "TOP",
118-
"material": "epoxyencapsulant",
118+
"material": "COPPER",
119119
"potting_units": "in",
120120
"thickness": 0.1,
121121
"standoff": 0.2,
@@ -134,7 +134,7 @@ def helper_test_add_potting_region(layer):
134134
"cca_name": "Test Card",
135135
"potting_id": "Test Region",
136136
"side": "TOP",
137-
"material": "epoxyencapsulant",
137+
"material": "COPPER",
138138
"potting_units": "in",
139139
"thickness": 0.1,
140140
"standoff": 0.2,
@@ -155,7 +155,7 @@ def helper_test_add_potting_region(layer):
155155
"cca_name": "Test Card",
156156
"potting_id": "Test Region",
157157
"side": "TOP",
158-
"material": "epoxyencapsulant",
158+
"material": "COPPER",
159159
"potting_units": "in",
160160
"thickness": 0.1,
161161
"standoff": 0.2,
@@ -177,7 +177,7 @@ def helper_test_add_potting_region(layer):
177177
"cca_name": "Test Card",
178178
"potting_id": "Test Region",
179179
"side": "TOP",
180-
"material": "epoxyencapsulant",
180+
"material": "COPPER",
181181
"potting_units": "in",
182182
"thickness": 0.1,
183183
"standoff": 0.2,
@@ -199,7 +199,7 @@ def helper_test_add_potting_region(layer):
199199
"cca_name": "Test Card",
200200
"potting_id": "Test Region",
201201
"side": "TOP",
202-
"material": "epoxyencapsulant",
202+
"material": "COPPER",
203203
"potting_units": "in",
204204
"thickness": 0.1,
205205
"standoff": 0.2,
@@ -224,7 +224,7 @@ def helper_test_add_potting_region(layer):
224224
"cca_name": "Main Board",
225225
"potting_id": potting_id,
226226
"side": "INVALID",
227-
"material": "epoxyencapsulant",
227+
"material": "COPPER",
228228
"potting_units": "in",
229229
"thickness": 0.1,
230230
"standoff": 0.2,
@@ -246,7 +246,7 @@ def helper_test_add_potting_region(layer):
246246
"cca_name": "Main Board",
247247
"potting_id": potting_id,
248248
"side": "TOP",
249-
"material": "epoxyencapsulant",
249+
"material": "COPPER",
250250
"potting_units": "in",
251251
"thickness": 0.1,
252252
"standoff": 0.2,

0 commit comments

Comments
 (0)