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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user