#=========================================================================
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)
# 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__':