X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Ftests%2FTest%2Ftutorial_1.py;h=253d6bf1f73456b0c2f24df7218a98395648777e;hb=refs%2Ftags%2FV9_13_0b1;hp=25fd349998f298bf641cb3a07a527e65e6222450;hpb=006b17c64a532b9b00f44ea9ef1605653cbcbf2f;p=modules%2Fhomard.git diff --git a/src/tests/Test/tutorial_1.py b/src/tests/Test/tutorial_1.py index 25fd3499..253d6bf1 100755 --- a/src/tests/Test/tutorial_1.py +++ b/src/tests/Test/tutorial_1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2011-2016 CEA/DEN, EDF R&D +# Copyright (C) 2011-2024 CEA, EDF # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,7 @@ Python script for HOMARD Test tutorial_1 associe au tutorial 1 """ -__revision__ = "V4.03" +__revision__ = "V4.07" #======================================================================== TEST_NAME = "tutorial_1" @@ -30,11 +30,9 @@ N_ITER_TEST_FILE = 3 #======================================================================== import os import sys -import HOMARD -import salome # # ================================== -PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR') +PATH_HOMARD = os.getenv("HOMARD_ROOT_DIR") # Repertoire des scripts utilitaires REP_PYTHON = os.path.join(PATH_HOMARD, "bin", "salome", "test", "HOMARD") REP_PYTHON = os.path.normpath(REP_PYTHON) @@ -43,15 +41,12 @@ from test_util import get_dir from test_util import test_results # ================================== # Répertoires pour ce test -REP_DATA, DIRCASE, DATA_TUTORIAL = get_dir(PATH_HOMARD, TEST_NAME, DEBUG) -# ================================== -sys.path.append(DATA_TUTORIAL) -from tutorial_util import gzip_gunzip +REP_DATA, DIRCASE = get_dir(PATH_HOMARD, TEST_NAME, DEBUG) # ================================== -gzip_gunzip(DATA_TUTORIAL, 1, -1) -# ================================== - -salome.salome_init() +# +import salome +salome.salome_init_without_session() +import HOMARD import iparameters IPAR = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1)) IPAR.append("AP_MODULES_LIST", "Homard") @@ -67,8 +62,8 @@ Python script for HOMARD message = "" # while not erreur : - # - HOMARD.SetCurrentStudy(salome.myStudy) + # + # HOMARD.UpdateStudy() # # Hypotheses # ========== @@ -138,7 +133,7 @@ while not ERREUR : assert HOMARD is not None, "Impossible to load homard engine" HOMARD.SetLanguageShort("fr") # - FICMED = os.path.join(DATA_TUTORIAL, TEST_NAME+".00.med") + FICMED = os.path.join(REP_DATA, TEST_NAME+".00.med") try: ERREUR, MESSAGE = homard_exec("MAILL", FICMED, DEBUG) except RuntimeError as eee: @@ -160,11 +155,8 @@ while not ERREUR : if ERREUR: raise Exception(MESSAGE) # -# ================================== -gzip_gunzip(DATA_TUTORIAL, 1, 1) -# ================================== # if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() iparameters.getSession().restoreVisualState(1)