Salome HOME
Finalize implementation of filter "F8: On/In/Out a Solid"
[modules/shaper.git] / src / PythonAPI / model / tests / tests.py
index 167f5c2bfb0522ee51289605f17c6587f833f9d0..687d2e1bb0c256440fbf26ab2d73c0791ad61cf4 100644 (file)
@@ -340,16 +340,22 @@ def checkFilter(thePartDoc, theModel, theFilter, theShapesList):
   aFiltersFactory = ModelAPI_Session.get().filters()
   for sel, res in theShapesList.items():
     needUndo = False
+    shapeName = ""
+    shapeType = "UNKNOWN"
     if sel.variantType() == ModelHighAPI_Selection.VT_ResultSubShapePair:
       shape = sel.resultSubShapePair()[1]
       if shape.isNull():
         shape = sel.resultSubShapePair()[0].shape()
+        shapeName = sel.name()
+        shapeType = shape.shapeTypeStr()
     else:
       needUndo = True
       theModel.begin()
       subShapeFeature = createSubShape(thePartDoc, theModel, sel)
       theModel.end()
       shape = subShapeFeature.results()[0].resultSubShapePair()[0].shape()
-    assert(aFiltersFactory.isValid(theFilter.feature(), shape) == res)
+      shapeType = sel.typeSubShapeNamePair()[0]
+      shapeName = sel.typeSubShapeNamePair()[1]
+    assert aFiltersFactory.isValid(theFilter.feature(), shape) == res, "Filter result for {} \"{}\" incorrect. Expected {}.".format(shapeType, shapeName, res)
     if needUndo:
       theModel.undo()