Salome HOME
ajout d'un test
authorGérald NICOLAS <gerald.nicolas@edf.fr>
Wed, 21 Jun 2023 07:19:58 +0000 (09:19 +0200)
committerGérald NICOLAS <gerald.nicolas@edf.fr>
Wed, 21 Jun 2023 07:19:58 +0000 (09:19 +0200)
src/PythonAddons/Test/TestmidSurface.py [deleted file]
src/PythonAddons/Test/TestmidSurface_1.py [new file with mode: 0755]
src/PythonAddons/Test/TestmidSurface_2.py [new file with mode: 0755]
src/PythonAddons/macros/midSurface/surfaceMediane.py
src/PythonAddons/tests.set

diff --git a/src/PythonAddons/Test/TestmidSurface.py b/src/PythonAddons/Test/TestmidSurface.py
deleted file mode 100755 (executable)
index 77c56a3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (C) 2014-2021  CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-from salome.shaper import model
-from ModelAPI import *
-
-import os
-
-aSession = ModelAPI_Session.get()
-
-def getFilePath(fileName):
-    path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "midSurface")
-    return os.path.join(path, fileName)
-
-theFile = getFilePath("midSurface.stp")
-
-aSession.startOperation("Create part for mid surface")
-aPartFeature = aSession.moduleDocument().addFeature("Part")
-aSession.finishOperation()
-aPart = aSession.activeDocument()
-
-aSession.startOperation("Import file")
-aFeatureKind = "midSurface"
-anImportFeature = aPart.addFeature(aFeatureKind)
-aFieldName = "file_path"
-aFile = anImportFeature.string(aFieldName)
-aFile.setValue(theFile)
-aSession.finishOperation()
-
-#for cle in ("Bodies", "Groups", "Construction", "Folders"):
-  #print (cle,":",aPart.size(cle))
-
-assert(aPart.size("Bodies") == 8), "Right number of construction: {}".format(aPart.size("Bodies"))
-assert(aPart.size("Construction") == 7), "Right number of construction: {}".format(aPart.size("Construction"))
-assert(aPart.size("Groups") == 2), "Right number of construction: {}".format(aPart.size("Groups"))
-assert(aPart.size("Folders") == 4), "Wrong number of folders: {}".format(aPart.size("Folders"))
diff --git a/src/PythonAddons/Test/TestmidSurface_1.py b/src/PythonAddons/Test/TestmidSurface_1.py
new file mode 100755 (executable)
index 0000000..77c56a3
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2014-2021  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+from ModelAPI import *
+
+import os
+
+aSession = ModelAPI_Session.get()
+
+def getFilePath(fileName):
+    path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "midSurface")
+    return os.path.join(path, fileName)
+
+theFile = getFilePath("midSurface.stp")
+
+aSession.startOperation("Create part for mid surface")
+aPartFeature = aSession.moduleDocument().addFeature("Part")
+aSession.finishOperation()
+aPart = aSession.activeDocument()
+
+aSession.startOperation("Import file")
+aFeatureKind = "midSurface"
+anImportFeature = aPart.addFeature(aFeatureKind)
+aFieldName = "file_path"
+aFile = anImportFeature.string(aFieldName)
+aFile.setValue(theFile)
+aSession.finishOperation()
+
+#for cle in ("Bodies", "Groups", "Construction", "Folders"):
+  #print (cle,":",aPart.size(cle))
+
+assert(aPart.size("Bodies") == 8), "Right number of construction: {}".format(aPart.size("Bodies"))
+assert(aPart.size("Construction") == 7), "Right number of construction: {}".format(aPart.size("Construction"))
+assert(aPart.size("Groups") == 2), "Right number of construction: {}".format(aPart.size("Groups"))
+assert(aPart.size("Folders") == 4), "Wrong number of folders: {}".format(aPart.size("Folders"))
diff --git a/src/PythonAddons/Test/TestmidSurface_2.py b/src/PythonAddons/Test/TestmidSurface_2.py
new file mode 100755 (executable)
index 0000000..77c56a3
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2014-2021  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+from ModelAPI import *
+
+import os
+
+aSession = ModelAPI_Session.get()
+
+def getFilePath(fileName):
+    path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "midSurface")
+    return os.path.join(path, fileName)
+
+theFile = getFilePath("midSurface.stp")
+
+aSession.startOperation("Create part for mid surface")
+aPartFeature = aSession.moduleDocument().addFeature("Part")
+aSession.finishOperation()
+aPart = aSession.activeDocument()
+
+aSession.startOperation("Import file")
+aFeatureKind = "midSurface"
+anImportFeature = aPart.addFeature(aFeatureKind)
+aFieldName = "file_path"
+aFile = anImportFeature.string(aFieldName)
+aFile.setValue(theFile)
+aSession.finishOperation()
+
+#for cle in ("Bodies", "Groups", "Construction", "Folders"):
+  #print (cle,":",aPart.size(cle))
+
+assert(aPart.size("Bodies") == 8), "Right number of construction: {}".format(aPart.size("Bodies"))
+assert(aPart.size("Construction") == 7), "Right number of construction: {}".format(aPart.size("Construction"))
+assert(aPart.size("Groups") == 2), "Right number of construction: {}".format(aPart.size("Groups"))
+assert(aPart.size("Folders") == 4), "Wrong number of folders: {}".format(aPart.size("Folders"))
index 6675949a575cc984504750d8a44298c9cb30ba6b..1e47e41d2f91037f0a88d33eb6bf312d714ca833 100755 (executable)
@@ -199,8 +199,6 @@ Sorties :
     objet_0 = objet.result()
   else:
     objet_0 = objet
-  #print (dir(objet))
-  #print (dir(objet_0))
 
 # 2. On descend dans l'arborescence des sous-objets jusqu'à en trouver un qui n'en n'a pas
 
@@ -572,11 +570,7 @@ Sorties :
 
 # 1. Extraction du solide
     remove_subshapes = model.addRemoveSubShapes(self.part_doc, model.selection("COMPOUND", self.objet_principal.name()))
-    #exec_nom (remove_subshapes)
-    #print ('remove_subshapes = model.addRemoveSubShapes(part_doc, model.selection("COMPOUND", "{}"))'.format(self.objet_principal.name()))
     remove_subshapes.setSubShapesToKeep([model.selection("SOLID", solide.name())])
-    #print ('remove_subshapes.setSubShapesToKeep([model.selection("SOLID", "{}")])'.format(solide.name()))
-    #exec_nom (remove_subshapes)
 
     self.nom_solide_aux = "{}_S".format(solide.name())
     if self._verbose_max:
@@ -880,9 +874,6 @@ Sorties :
     if face is not None:
       self._cree_face_mediane_0 ( face, n_recur )
 
-    if self._verbose_max:
-      print_tab (n_recur, "Sortie de "+blabla)
-
     return erreur, face
 
 #===========================  Fin de la méthode ==================================
@@ -920,9 +911,6 @@ Entrées :
 # 4. Changement de statut pour le solide
     self.d_statut_so[self.nom_solide] = 1
 
-    if self._verbose_max:
-      print_tab (n_recur, "Sortie de _cree_face_mediane_0")
-
 #===========================  Fin de la méthode ==================================
 
 #=========================== Début de la méthode =================================
index 62f6853ce4b258df23bba94f7278a35414d2e206..66bdf4d731a505a19c2f165406b7d2df6ea85741 100644 (file)
@@ -22,7 +22,8 @@ SET(TEST_NAMES
   TestRectangleCentered.py
   TestcompoundVertices.py
   TestimportParameters.py
-  TestmidSurface.py
+  TestmidSurface_1.py
+  TestmidSurface_2.py
   TestpipeNetwork_2par2.py
   TestpipeNetwork_parligne.py
 )