Salome HOME
Pipe validator fix
[modules/shaper.git] / src / ExchangePlugin / Test / TestImport.py
index 5a7b23d2a5437fd5dd0295877de518627abd5cea..5756228a69e34be3da665bb97ab06622e5f92711 100644 (file)
@@ -20,16 +20,16 @@ aSession = ModelAPI_Session.get()
 #=========================================================================
 def testImport(theType, theFile, theVolume, theDelta):
     # Create a part for import
-    aSession.startOperation()
+    aSession.startOperation("Create part for import")
     aPartFeature = aSession.moduleDocument().addFeature("Part")
     aSession.finishOperation()
     aPart = aSession.activeDocument()
     
-    aSession.startOperation()
+    aSession.startOperation("Import file")
     aFeatureKind = "Import"
     anImportFeature = aPart.addFeature(aFeatureKind)
     assert anImportFeature, "{0}: Can not create a feature {1}".format(theType, aFeatureKind)
-    aFieldName = "import_file_selector"
+    aFieldName = "file_path"
     file = anImportFeature.string(aFieldName)
     assert file, "{0}: Can not receive string field {1}".format(theType, aFieldName)
     file.setValue(theFile)
@@ -46,7 +46,7 @@ def testImport(theType, theFile, theVolume, theDelta):
     
     # Check shape volume
     aRefVolume = theVolume
-    aResVolume = GeomAlgoAPI_ShapeProps.volume(aShape)
+    aResVolume = GeomAlgoAPI_ShapeTools.volume(aShape)
     assert (math.fabs(aResVolume - aRefVolume) < theDelta), "{0}: The volume is wrong: expected = {1}, real = {2}".format(theType, aRefVolume, aResVolume)
 
 if __name__ == '__main__':
@@ -54,6 +54,7 @@ if __name__ == '__main__':
 # Create a shape imported from BREP
 #=========================================================================
     testImport("BREP", "Data/solid.brep", 259982.29715, 10 ** -5)
+    testImport("BRP", "Data/solid.brp", 259982.29715, 10 ** -5)
 #=========================================================================
 # Create a shape imported from STEP
 #=========================================================================