Skip to content

Commit 4d7e3cd

Browse files
committed
Merge pull request #263 from jf---/jf/exception_handling_wrapper_test
jf/exception_handling_wrapper_test
2 parents 64fa604 + de6c2ac commit 4d7e3cd

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/core_wrapper_features_unittest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,19 @@ def test_default_constructor_DEFINE_STANDARD_ALLOC(self):
387387
TopoDS_Builder()
388388
ShapeAnalysis_Curve()
389389

390+
def test_handling_exceptions(self):
391+
""" asserts that handling of OCC exceptions is handled correctly in pythonocc
392+
393+
See Also
394+
--------
395+
396+
issue #259 -- Standard errors like Standard_OutOfRange not caught
397+
398+
"""
399+
d = gp_Dir(0,0,1)
400+
with self.assertRaises(RuntimeError):
401+
d.Coord(-1) # Standard_OutOfRange
402+
390403

391404
def suite():
392405
test_suite = unittest.TestSuite()

0 commit comments

Comments
 (0)