From 4f5bcd7bc8b797fe29d2f6a0aa1e7660b643a81c Mon Sep 17 00:00:00 2001 From: NiJingzhe <1448976235@qq.com> Date: Thu, 29 Oct 2026 22:54:38 +0800 Subject: [PATCH] test: the verifier-bridge test follows shape.wrapped becoming an OCP shape PR #67's test_the_sdk_wrapped_shape_is_not_an_ocp_shape asserted that OCP rejects shape.wrapped; with OCP installed wrapped is now an OCP shape (a deliberate change of this branch). The original assertion is kept for the SDK's own binding (SCA_WRAPPED=native), and a new test pins the new default: OCP measures solid.wrapped. Co-Authored-By: Claude Sonnet 5.5 --- src/cpp/tests/python/test_verify_bridge.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cpp/tests/python/test_verify_bridge.py b/src/cpp/tests/python/test_verify_bridge.py index 969c3061..8e587f92 100644 --- a/src/cpp/tests/python/test_verify_bridge.py +++ b/src/cpp/tests/python/test_verify_bridge.py @@ -40,11 +40,19 @@ def volume(shape): return props.Mass() -def test_the_sdk_wrapped_shape_is_not_an_ocp_shape(): +def test_the_sdks_own_binding_is_not_an_ocp_shape(monkeypatch): + """The SDK's own OCCT binding (what `.wrapped` was before it became an OCP shape) is rejected by OCP functions.""" + monkeypatch.setenv("SCA_WRAPPED", "native") with pytest.raises(TypeError, match="incompatible"): BRepGProp.VolumeProperties_s(part().wrapped, GProp_GProps()) +def test_wrapped_is_an_ocp_shape_when_ocp_is_installed(monkeypatch): + monkeypatch.delenv("SCA_WRAPPED", raising=False) + solid = part() + assert math.isclose(volume(solid.wrapped), solid.get_volume(), rel_tol=1e-12) + + def test_to_ocp_measures_like_the_sdk(): solid = part() shape = verify.to_ocp(solid)