Part: add test for Geom2d.toShape
This commit is contained in:
@@ -64,6 +64,7 @@ set(CompoundTools_Scripts
|
||||
|
||||
set(Part_tests
|
||||
parttests/__init__.py
|
||||
parttests/Geom2d_tests.py
|
||||
parttests/part_test_objects.py
|
||||
parttests/regression_tests.py
|
||||
parttests/TopoShapeListTest.py
|
||||
|
||||
@@ -27,6 +27,7 @@ from FreeCAD import Units
|
||||
from FreeCAD import Base
|
||||
App = FreeCAD
|
||||
|
||||
from parttests.Geom2d_tests import Geom2dTests
|
||||
from parttests.regression_tests import RegressionTests
|
||||
from parttests.TopoShapeListTest import TopoShapeListTest
|
||||
|
||||
|
||||
20
src/Mod/Part/parttests/Geom2d_tests.py
Normal file
20
src/Mod/Part/parttests/Geom2d_tests.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import FreeCAD
|
||||
vec2 = FreeCAD.Base.Vector2d
|
||||
import Part
|
||||
|
||||
import unittest
|
||||
|
||||
class Geom2dTests(unittest.TestCase):
|
||||
|
||||
def test_toShape(self):
|
||||
surf = Part.Cylinder()
|
||||
|
||||
p1 = vec2(1.0, -1.0)
|
||||
p2 = vec2(2.0, -1.0)
|
||||
|
||||
l12 = Part.Geom2d.Line2dSegment(p1, p2)
|
||||
|
||||
e1 = l12.toShape()
|
||||
e2 = l12.toShape(surf)
|
||||
self.assertNotEqual(e1.curveOnSurface(0), None)
|
||||
self.assertNotEqual(e2.curveOnSurface(0), None)
|
||||
Reference in New Issue
Block a user