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
1 change: 1 addition & 0 deletions doc/changelog.d/624.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated test assertion and test point enums to fix failing unit tests
3 changes: 2 additions & 1 deletion src/ansys/sherlock/core/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,7 @@ def update_test_points(
>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> from ansys.sherlock.core.types.layer_types import UpdateTestPointsRequest,
>>> TestPointProperties
>>> from ansys.api.sherlock.v0 import SherlockLayerService_pb2
>>> sherlock = connect()
>>> test_point = TestPointProperties(
>>> id="TP1",
Expand All @@ -2169,7 +2170,7 @@ def update_test_points(
>>> center_x=1.0,
>>> center_y=0.5,
>>> radius=0.2,
>>> load_type="Force",
>>> load_type=SherlockLayerService_pb2.TestPointProperties.LoadType.Force,
>>> load_value=3.0,
>>> load_units="ozf",
>>> )
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/sherlock/core/types/layer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class TestPointProperties(BaseModel):
"""Center y-value"""
radius: float
"""Radius"""
load_type: str
load_type: SherlockLayerService_pb2.TestPointProperties.LoadType.ValueType
"""Load type"""
load_value: float
"""Load value"""
Expand Down
7 changes: 4 additions & 3 deletions tests/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import platform
import uuid

from ansys.api.sherlock.v0 import SherlockLayerService_pb2
import grpc
import pydantic
import pytest
Expand Down Expand Up @@ -1870,7 +1871,7 @@ def helper_test_update_test_points(layer):
center_x=1.0,
center_y=0.5,
radius=0.2,
load_type="Force",
load_type=SherlockLayerService_pb2.TestPointProperties.LoadType.Force,
load_value=3.0,
load_units="ozf",
)
Expand All @@ -1882,7 +1883,7 @@ def helper_test_update_test_points(layer):
center_x=-30,
center_y=-10,
radius=5,
load_type="Displacement",
load_type=SherlockLayerService_pb2.TestPointProperties.LoadType.Displacement,
load_value=0,
load_units="in",
)
Expand All @@ -1894,7 +1895,7 @@ def helper_test_update_test_points(layer):
center_x=60,
center_y=-40,
radius=4,
load_type="Force",
load_type=SherlockLayerService_pb2.TestPointProperties.LoadType.Force,
load_value=5,
load_units="N",
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_version_check():


def assert_float_equals(expected, actual):
assert pytest.approx(expected, abs=1e-14) == pytest.approx(actual, abs=1e-14)
assert pytest.approx(actual, abs=1e-14) == pytest.approx(expected, abs=1e-14)


if __name__ == "__main__":
Expand Down
Loading