Salome HOME
Increment version: 9.2.0
[modules/shaper.git] / src / FeaturesPlugin / Test / TestExtrusion.py
index cd204d7ed396c2a53f3f8a623778effa126176da..5e44cac127913e038df1dc283cb72ffa9e22fb89 100644 (file)
@@ -1,7 +1,27 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
 """
       TestExtrusion.py
       Unit test of FeaturesPlugin_Extrusion class
-      
+
       class FeaturesPlugin_Extrusion : public ModelAPI_Feature
         static const std::string MY_EXTRUSION_ID("Extrusion");
         static const std::string LIST_ID("base");
@@ -57,8 +77,8 @@ norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
 # Create circle
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
-anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
-aCircleRadius = aSketchCircle.real("CircleRadius")
+anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
+aCircleRadius = aSketchCircle.real("circle_radius")
 anCircleCentr.setValue(50., 50)
 aCircleRadius.setValue(20.)
 aSession.finishOperation()
@@ -103,7 +123,8 @@ assert (anExtrusionResult is not None)
 # Create from plane
 aSession.startOperation()
 aFromPlaneFeature = aPart.addFeature("Plane")
-aFromPlaneFeature.string("CreationMethod").setValue("PlaneByGeneralEquation")
+aFromPlaneFeature.string("creation_method").setValue("by_general_equation")
+aFromPlaneFeature.string("by_other_plane_option").setValue("by_distance_from_other") # TODO: remove
 aFromPlaneFeature.real("A").setValue(0.)
 aFromPlaneFeature.real("B").setValue(0.)
 aFromPlaneFeature.real("C").setValue(1.)
@@ -113,7 +134,8 @@ aSession.finishOperation()
 # Create to plane
 aSession.startOperation()
 aToPlaneFeature = aPart.addFeature("Plane")
-aToPlaneFeature.string("CreationMethod").setValue("PlaneByGeneralEquation")
+aToPlaneFeature.string("creation_method").setValue("by_general_equation")
+aToPlaneFeature.string("by_other_plane_option").setValue("by_distance_from_other") # TODO: remove
 aToPlaneFeature.real("A").setValue(0.)
 aToPlaneFeature.real("B").setValue(0.)
 aToPlaneFeature.real("C").setValue(1.)
@@ -228,9 +250,9 @@ anExtrusionFt.selectionList("base").append(
 anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anExtrusionFt.real("to_size").setValue(0) #TODO: remove
 anExtrusionFt.real("from_size").setValue(0) #TODO: remove
-anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3/LateralFace_2")
+anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_3")
 anExtrusionFt.real("to_offset").setValue(0)
-anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3/LateralFace_1")
+anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_4")
 anExtrusionFt.real("from_offset").setValue(0)
 anExtrusionFt.execute()
 aSession.finishOperation()
@@ -243,3 +265,6 @@ assert (anExtrusionResult is not None)
 #=========================================================================
 # End of test
 #=========================================================================
+
+from salome.shaper import model
+assert(model.checkPythonDump())