Salome HOME
Updated copyright comment
[modules/homard.git] / src / tests / Test / test_1.py
index cbc2a598277bcfdb0e602e7f074eccca961c5752..d7dcb150a063901fe6339d1cdd53de0cdd3a1f02 100755 (executable)
@@ -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 test_1
 """
-__revision__ = "V4.03"
+__revision__ = "V4.05"
 
 #========================================================================
 TEST_NAME = "test_1"
@@ -46,14 +46,14 @@ from test_util import test_results
 REP_DATA, DIRCASE = get_dir(PATH_HOMARD, TEST_NAME, DEBUG)
 # ==================================
 
-salome.salome_init()
+salome.salome_init_without_session()
 import iparameters
 IPAR = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
 IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -61,7 +61,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+  #  HOMARD.UpdateStudy()
   #
   # Creation of the zones
   # =====================
@@ -175,6 +175,7 @@ Python script for HOMARD
     scriptfile = os.path.normpath(scriptfile)
     dirname = DIRCASE
     yacs_test_1 = case_test_1.CreateYACSSchema("YACS_test_1", scriptfile, dirname, mesh_file)
+    yacs_test_1.SetMaxIter(N_ITER_TEST_FILE)
     error = yacs_test_1.Write()
     if error :
       error = 4
@@ -193,7 +194,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except RuntimeError as eee:
@@ -206,6 +207,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)