From b090c94333e03c317704ea05cba728154b7c492e Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 28 Jan 2020 09:33:31 +0300 Subject: [PATCH] Update unit tests for B-spline feature --- src/SketchPlugin/CMakeLists.txt | 5 +++++ src/SketchPlugin/Test/TestConstraintCoincidenceBSpline.py | 2 +- src/SketchPlugin/Test/TestConstraintTangentBSpline.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index 3fde1ddf8..27965e742 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -237,6 +237,7 @@ ADD_UNIT_TESTS( TestConstraintAngleBehaviorBackward_2.py TestConstraintAngleEllipse.py TestConstraintCoincidence.py + TestConstraintCoincidenceBSpline.py TestConstraintCoincidenceEllipse.py TestConstraintCoincidenceEllipticArc.py TestConstraintCollinear.py @@ -275,6 +276,7 @@ ADD_UNIT_TESTS( TestCreateArcByTransversalLine.py TestCreateArcChangeType.py TestCreateBSpline.py + TestCreateBSplinePeriodic.py TestCreateCircleByCenterAndPassed.py TestCreateCircleByThreePoints.py TestCreateCircleChangeType.py @@ -311,6 +313,7 @@ ADD_UNIT_TESTS( TestPresentation.py TestProjection.py TestProjectionBSpline.py + TestProjectionBSplinePeriodic.py TestProjectionEllipse.py TestProjectionEllipticArc.py TestProjectionIntoResult.py @@ -318,6 +321,7 @@ ADD_UNIT_TESTS( TestRectangle.py TestRemainingDoF.py TestRemoveBSpline.py + TestRemoveBSplinePeriodic.py TestRemoveEllipse.py TestRemoveEllipticArc.py TestRemoveSketch.py @@ -356,6 +360,7 @@ if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE}) ADD_UNIT_TESTS( TestMoveArc.py TestMoveBSpline.py + TestMoveBSplinePeriodic.py TestMoveCircle.py TestMoveEllipse.py TestMoveEllipticArc.py diff --git a/src/SketchPlugin/Test/TestConstraintCoincidenceBSpline.py b/src/SketchPlugin/Test/TestConstraintCoincidenceBSpline.py index 80ab412e2..36a0426fe 100644 --- a/src/SketchPlugin/Test/TestConstraintCoincidenceBSpline.py +++ b/src/SketchPlugin/Test/TestConstraintCoincidenceBSpline.py @@ -99,7 +99,7 @@ class TestCoincidenceBSpline(unittest.TestCase): def assertPointOnSpline(self, thePoint, theSpline): point = GeomAPI_Pnt(thePoint.x(), thePoint.y(), 0.0) - bspline = GeomAPI_BSpline(GeomAPI_Curve(theSpline.results()[-1].resultSubShapePair()[0].shape())) + bspline = GeomAPI_Curve(theSpline.results()[-1].resultSubShapePair()[0].shape()) proj = bspline.project(point) self.assertAlmostEqual(point.distance(proj), 0.0) diff --git a/src/SketchPlugin/Test/TestConstraintTangentBSpline.py b/src/SketchPlugin/Test/TestConstraintTangentBSpline.py index 58a22c38e..e3e758bb6 100644 --- a/src/SketchPlugin/Test/TestConstraintTangentBSpline.py +++ b/src/SketchPlugin/Test/TestConstraintTangentBSpline.py @@ -205,7 +205,7 @@ class TestTangentBSpline(unittest.TestCase): def test_line_tangent_coincident_by_pole(self): """ Test 7. Set tangency between B-spline and a line coincident with B-spline start point """ - aLine = self.mySketch.addLine(10, -10, 90, 40) + aLine = self.mySketch.addLine(-15, -25, 50, 40) self.myNbLines += 1 self.myDOF += 4 model.do() -- 2.39.2