solid.loft: added checking for at least 2 wires to prevent segmentation fault. see issue #161. now a ValueError is raised
This commit is contained in:
@ -259,6 +259,15 @@ class TestCadQuery(BaseTest):
|
||||
# the resulting loft had a split on the side, not sure why really, i expected only 3 faces
|
||||
self.assertEqual(7, s.faces().size())
|
||||
|
||||
def testLoftWithOneWireRaisesValueError(self):
|
||||
s = Workplane("XY").circle(5)
|
||||
try:
|
||||
s.loft()
|
||||
self.assertFail()
|
||||
except ValueError as e:
|
||||
self.assertEqual(str(e), "More than one wire is required")
|
||||
|
||||
|
||||
def testLoftCombine(self):
|
||||
"""
|
||||
test combining a lof with another feature
|
||||
@ -2050,4 +2059,4 @@ class TestCadQuery(BaseTest):
|
||||
# find solid should return a compund of two solids
|
||||
s = r.findSolid()
|
||||
self.assertEqual(len(s.Solids()),2)
|
||||
self.assertTrue(isinstance(s,Compound))
|
||||
self.assertTrue(isinstance(s,Compound))
|
||||
|
Reference in New Issue
Block a user