]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add tests for features and fix some bugs.
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 3 Nov 2015 09:01:48 +0000 (12:01 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Tue, 3 Nov 2015 09:01:48 +0000 (12:01 +0300)
src/PythonAPI/CMakeLists.txt
src/PythonAPI/model/construction/axis.py
src/PythonAPI/model/construction/plane.py
src/PythonAPI/model/construction/point.py
src/PythonAPI/model/exchange/exchange.py
src/PythonAPI/model/features/boolean.py
src/PythonAPI/model/parameter/parameter.py

index f2e24fad69291a596e82902b12918ad6bc099c03..dc1ee767a70e7e727714abc7dfa0801ae003a1fe 100644 (file)
@@ -28,6 +28,7 @@ ADD_UNIT_TESTS(
   TestSketcherSetEqual.py
   TestSketcherSetFillet.py
 
+  TestFeatures.py
   TestFeaturesExtrusion.py
   TestFeaturesRevolution.py
 
index 0afedf9bb10e10c6cd8905679b020981a8843afc..5e26942275e2567c4c69ae757ace06a55399b411 100644 (file)
@@ -11,6 +11,7 @@ def addAxis(part, *args):
 
     Pass all args to Axis __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Axis")
     return Axis(feature, *args)
 
index b2144d9ecaa0350a11796fd2bb975b77f7438f8f..f007de2481afc53aa8f6b3c54afa617489f16073 100644 (file)
@@ -11,6 +11,7 @@ def addPlane(part, *args):
 
     Pass all args to Plane __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Plane")
     return Plane(feature, *args)
 
index d2448bc67610f3da9989f45e976a6cf036c192c0..6d04280070bdccd9cfd1c4fb20e90d76a1cbd2f5 100644 (file)
@@ -11,6 +11,7 @@ def addPoint(part, *args):
 
     Pass all args to Point __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Point")
     return Point(feature, *args)
 
index a7b7daa0ec311d3507010144c7dcb46cdb95771c..66f5c780927c87d2d1f7ffa43c41efc8600f3054 100644 (file)
@@ -11,6 +11,7 @@ def addImport(part, *args):
 
     Pass all args to Import __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Import")
     return Import(feature, *args)
 
@@ -56,6 +57,7 @@ def exportToFile(part, *args):
 
     Pass all args to Export __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Export")
     return Export(feature, *args)
 
index d746ffefdcaa84b2829f7e2e84ce93bb49e23fa0..95e27d019fb0348c8734439fdafbb20ba5c488ba 100644 (file)
@@ -10,26 +10,32 @@ from GeomAlgoAPI import *
 from model.roots import Interface
 
 
-def addAddition(part, object, tool):
+def addAddition(part, *args):
     """Inserts an addition to the given Part and executes the operation.
     This operation adds tool to the given object.
     """
+    assert(args)
+    object, tool = args
     feature = part.addFeature("Boolean")
     return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_FUSE)
 
 
-def addSubtraction(part, object, tool):
+def addSubtraction(part, *args):
     """Inserts a subtraction to the given Part and executes the operation.
     This operation subtracts tool to the given object.
     """
+    assert(args)
+    object, tool = args
     feature = part.addFeature("Boolean")
     return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_CUT)
 
 
-def addIntersection(part, object, tool):
+def addIntersection(part, *args):
     """Inserts an intersection to the given Part and executes the operation.
     This operation intersects tool to the given object.
     """
+    assert(args)
+    object, tool = args
     feature = part.addFeature("Boolean")
     return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_COMMON)
 
index 7dfe03c446d4b33f4ea94f4a73e4d8a8845e5342..9b436b710f632b382f2203de6e5d1d31a9c6db3c 100644 (file)
@@ -11,6 +11,7 @@ def addParameter(part, *args):
 
     Pass all args to Parameter __init__ function.
     """
+    assert(args)
     feature = part.addFeature("Parameter")
     return Parameter(feature, *args)
 
@@ -30,8 +31,8 @@ class Parameter(Interface):
         Interface.__init__(self, feature)
         assert(self._feature.getKind() == "Parameter")
 
-        self._variable = self._feature.data().selection("variable")
-        self._expression = self._feature.data().real("expression")
+        self._variable = self._feature.data().string("variable")
+        self._expression = self._feature.data().string("expression")
 
         assert(self._variable)
         assert(self._expression)