From: Anthony Geay Date: Mon, 13 Feb 2023 08:40:43 +0000 (+0100) Subject: [EDF26936] : helper for test purpose X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c5fca2522ed2297ee94139163f61c29c976c549;p=modules%2Fkernel.git [EDF26936] : helper for test purpose --- diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 8c05dbac6..c3bd7fbec 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -411,9 +411,12 @@ def salome_shutdown_containers_with_session(): ref_in_ns = "/".join(root+[cont_name]) naming_service.Destroy_Name(ref_in_ns) print("Number of containers in NS after clean : {}".format( len( list(salome_walk_on_containers(ns,[""])) ))) + +def retrieve_containers_in_ns(): + return [elt for elt in naming_service.repr() if "/Containers/" == elt[:12]] def salome_shutdown_containers_without_session(): - containersEntries = [elt for elt in naming_service.repr() if "/Containers/" == elt[:12]] + containersEntries = retrieve_containers_in_ns() for containerEntry in containersEntries: cont = naming_service.Resolve(containerEntry) try: