Salome HOME
[Code coverage GeomAlgoAPI]: Cover error messages in transformations
[modules/shaper.git] / test.API / SHAPER / Transformations / TestAPI_Scale.py
index 8fc2c52449a0f10ecb08347570a6b6a16dd6e095..dccc3573de46c8b70e24b63f2fd65ec224b6938d 100644 (file)
@@ -20,7 +20,7 @@
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Pnt as pnt, GeomAPI_Shape as shape
 
 # Create Boxes
 Box_1 = shaperpy.makeBox(10.,10.,10.)
@@ -77,4 +77,19 @@ Scale_17 = shaperpy.makeScale(Box_11, pntOrigin, -2., -3., 0.5)
 try :
     Scale_18 = shaperpy.makeScale(Box_12, None, 2., 3., 1.)
 except myExcept as ec :
-    assert(ec.what() == "Scale builder :: center point is not valid.")
\ No newline at end of file
+    assert(ec.what() == "Scale builder :: center point is not valid.")
+
+try :
+    Scale_19 = shaperpy.makeScale(None, pntOrigin, 2., 3., 1.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape is not valid.")
+
+try :
+    Scale_20 = shaperpy.makeScale(shape(), pntOrigin, 2.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape does not contain any actual shape.")
+
+try :
+    Scale_21 = shaperpy.makeScale(shape(), pntOrigin, 2., 3., 1.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape does not contain any actual shape.")