From: nds Date: Tue, 4 Apr 2017 07:42:11 +0000 (+0300) Subject: Issue #2027 Sketcher Trim Feature: unit-tests X-Git-Tag: V_2.7.0~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=02ed48c7a4a5cd368caaa54db6724a264ce8322a;p=modules%2Fshaper.git Issue #2027 Sketcher Trim Feature: unit-tests --- diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index 96e7591c9..75fe9e993 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -163,4 +163,19 @@ ADD_UNIT_TESTS(TestSketchPointLine.py Test1673.py Test1924.py Test1966.py - Test1967.py) + Test1967.py + TestTrimArc01.py + TestTrimArc02.py + TestTrimArc03.py + TestTrimArc04.py + TestTrimArc05.py + TestTrimArc06.py + TestTrimArc07.py + TestTrimCircle01.py + TestTrimCircle02.py + TestTrimCircle03.py + TestTrimCircle04.py + TestTrimCircle05.py + TestTrimCircleAndArc01.py + TestTrimLine01.py + TestTrimLine02.py) diff --git a/src/SketchPlugin/Test/TestTrimArc01.py b/src/SketchPlugin/Test/TestTrimArc01.py index c7a2e29ca..a8e63cff0 100644 --- a/src/SketchPlugin/Test/TestTrimArc01.py +++ b/src/SketchPlugin/Test/TestTrimArc01.py @@ -93,4 +93,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc02.py b/src/SketchPlugin/Test/TestTrimArc02.py index 4b1cbf4b6..9098e7413 100644 --- a/src/SketchPlugin/Test/TestTrimArc02.py +++ b/src/SketchPlugin/Test/TestTrimArc02.py @@ -98,4 +98,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc03.py b/src/SketchPlugin/Test/TestTrimArc03.py index 55c17601b..1f8f0253d 100644 --- a/src/SketchPlugin/Test/TestTrimArc03.py +++ b/src/SketchPlugin/Test/TestTrimArc03.py @@ -102,4 +102,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc04.py b/src/SketchPlugin/Test/TestTrimArc04.py index c694ef490..b56d6bd1f 100644 --- a/src/SketchPlugin/Test/TestTrimArc04.py +++ b/src/SketchPlugin/Test/TestTrimArc04.py @@ -102,4 +102,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc05.py b/src/SketchPlugin/Test/TestTrimArc05.py index 1bf8ae699..c8fd1044a 100644 --- a/src/SketchPlugin/Test/TestTrimArc05.py +++ b/src/SketchPlugin/Test/TestTrimArc05.py @@ -103,4 +103,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc06.py b/src/SketchPlugin/Test/TestTrimArc06.py index 610946cb3..658998900 100644 --- a/src/SketchPlugin/Test/TestTrimArc06.py +++ b/src/SketchPlugin/Test/TestTrimArc06.py @@ -102,4 +102,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimArc07.py b/src/SketchPlugin/Test/TestTrimArc07.py index b94d921b8..a8099f486 100644 --- a/src/SketchPlugin/Test/TestTrimArc07.py +++ b/src/SketchPlugin/Test/TestTrimArc07.py @@ -53,14 +53,6 @@ model.do() SketchTrim = Sketch.addTrim(SketchArc_1, Sketch.to2D(GeomPoint)) SketchTrim.execute() - -# Another case -#GeomPoint = geom.Pnt2d(60, 50) -#model.do() -#SketchTrim = Sketch.addTrim(SketchArc_1, GeomPoint) -#SketchTrim.execute() - - model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircle01.py b/src/SketchPlugin/Test/TestTrimCircle01.py index f9e270d05..cbd7509cf 100644 --- a/src/SketchPlugin/Test/TestTrimCircle01.py +++ b/src/SketchPlugin/Test/TestTrimCircle01.py @@ -90,4 +90,4 @@ assert(len(Intersection_Points_3) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircle02.py b/src/SketchPlugin/Test/TestTrimCircle02.py index e843c55da..b85aef8b8 100644 --- a/src/SketchPlugin/Test/TestTrimCircle02.py +++ b/src/SketchPlugin/Test/TestTrimCircle02.py @@ -89,4 +89,4 @@ assert(len(Intersection_Points_3) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircle03.py b/src/SketchPlugin/Test/TestTrimCircle03.py index e95823b03..3e426dcd9 100644 --- a/src/SketchPlugin/Test/TestTrimCircle03.py +++ b/src/SketchPlugin/Test/TestTrimCircle03.py @@ -94,4 +94,4 @@ assert(len(Intersection_Points_3) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircle04.py b/src/SketchPlugin/Test/TestTrimCircle04.py index 57db65228..0d3adb8be 100644 --- a/src/SketchPlugin/Test/TestTrimCircle04.py +++ b/src/SketchPlugin/Test/TestTrimCircle04.py @@ -95,4 +95,4 @@ assert(len(Intersection_Points_3) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircle05.py b/src/SketchPlugin/Test/TestTrimCircle05.py index d53d89b93..5bd00a673 100644 --- a/src/SketchPlugin/Test/TestTrimCircle05.py +++ b/src/SketchPlugin/Test/TestTrimCircle05.py @@ -99,4 +99,4 @@ assert(len(Intersection_Points_3) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimCircleAndArc01.py b/src/SketchPlugin/Test/TestTrimCircleAndArc01.py index 1bb501b1e..b4885a635 100644 --- a/src/SketchPlugin/Test/TestTrimCircleAndArc01.py +++ b/src/SketchPlugin/Test/TestTrimCircleAndArc01.py @@ -90,23 +90,11 @@ assert(idList_after.count(SketchLineId) == 6) assert(idList_after.count(SketchConstraintCoincidenceId) == 8) -#check arc position intersections of created arc to an additional line -#SketchLine_intersecting_1 = Sketch.addLine(0, 0, 50, 50) -#SketchLine_intersecting_2 = Sketch.addLine(50, 50, 100, 100) - -#Intersection_Points_1 = ModelGeomAlgo_Point2D.getSetOfPntIntersectedShape(SketchArc, FeatureList([SketchLine_intersecting_1.feature()])) -#Intersection_Points_2 = ModelGeomAlgo_Point2D.getSetOfPntIntersectedShape(SketchArc, FeatureList([SketchLine_intersecting_2.feature()])) - -#assert(len(Intersection_Points_1) == 1) -#assert(len(Intersection_Points_2) == 0) - #add point for check SketchPoint = Sketch.addPoint(GeomPoint.x(), GeomPoint.y()) Intersection_Points_3 = ModelGeomAlgo_Point2D.getSetOfPntIntersectedShape(SketchArc, FeatureList([SketchPoint.feature()])) assert(len(Intersection_Points_3) == 0) - - #perform trim: horizontal #second intersection point - horizontal SketchLine_intersecting_h = Sketch.addLine(10, 48, 72, 48) @@ -154,4 +142,4 @@ assert(len(Intersection_Points_5) == 0) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimLine01.py b/src/SketchPlugin/Test/TestTrimLine01.py index 5256326fb..b823a6ceb 100644 --- a/src/SketchPlugin/Test/TestTrimLine01.py +++ b/src/SketchPlugin/Test/TestTrimLine01.py @@ -68,4 +68,4 @@ assert(idList_after.count(SketchConstraintCoincidenceId) == 2) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump()) diff --git a/src/SketchPlugin/Test/TestTrimLine02.py b/src/SketchPlugin/Test/TestTrimLine02.py index 9730f8e07..d9f3aa3d6 100644 --- a/src/SketchPlugin/Test/TestTrimLine02.py +++ b/src/SketchPlugin/Test/TestTrimLine02.py @@ -85,4 +85,4 @@ assert(len(Intersection_Points_5) == 1) model.end() -#assert(model.checkPythonDump()) +assert(model.checkPythonDump())