From f2439c74a27e0620f16e5f77c9b9fae6d1b5fbe4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 29 Jun 2021 16:38:53 +0200 Subject: [PATCH] Test OK --- src/PythonAddons/Test/TestpipeNetwork.py | 13 ++++++++----- src/PythonAddons/macros/pipeNetwork/feature.py | 5 ++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/PythonAddons/Test/TestpipeNetwork.py b/src/PythonAddons/Test/TestpipeNetwork.py index c4e507cbd..2d2dc3fe3 100755 --- a/src/PythonAddons/Test/TestpipeNetwork.py +++ b/src/PythonAddons/Test/TestpipeNetwork.py @@ -16,17 +16,18 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -__revision__ = "V01.02" +"""Test de la création du réseau de tuyaux""" -from salome.shaper import model -from salome.shaper import geom -from ModelAPI import * +__revision__ = "V01.03" import os +from ModelAPI import * + aSession = ModelAPI_Session.get() def getFilePath(fileName): + """Le fichier décrivant le réseau""" path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "pipeNetwork") return os.path.join(path, fileName) @@ -46,4 +47,6 @@ aFile = anImportFeature.string(aFieldName) aFile.setValue(theFile) aSession.finishOperation() -assert(model.checkPythonDump()) +assert(aPart.size("Construction") == 21), "Wrong number of construction: {}".format(aPart.size("Construction")) + +assert(aPart.size("Folders") == 1), "Wrong number of folders: {}".format(aPart.size("Folders")) diff --git a/src/PythonAddons/macros/pipeNetwork/feature.py b/src/PythonAddons/macros/pipeNetwork/feature.py index 828fcad77..27123a99f 100755 --- a/src/PythonAddons/macros/pipeNetwork/feature.py +++ b/src/PythonAddons/macros/pipeNetwork/feature.py @@ -22,7 +22,7 @@ Author: Nathalie Gore """ -__revision__ = "V02.03" +__revision__ = "V02.04" from salome.shaper import model import ModelAPI @@ -501,7 +501,7 @@ class pipeNetwork(model.Feature): print("========================= Création des paths =========================") for key, value in self.connectivities.items(): if self._verbose: - print("================================================================================= key = ", key, value['chainage'], value['fillet']) + print("================================================================================= key = ", key, value['chainage'], value['fillet']) # recherche des noeuds fillets value["paths"] = list() value["isPipe"] = list() @@ -579,7 +579,6 @@ class pipeNetwork(model.Feature): fuse.execute(True) self.lfeatures.append(fuse) fuse.result().setName(nameRes) - print (dir(fuse)) self.folder = model.addFolder(part, self.lfeatures[0], self.lfeatures[-1]) self.folder.setName(nameRes) -- 2.39.2