Salome HOME
updated copyright message
[modules/homard.git] / src / tests / Test / test_3.py
index 92525f35829e411491de0a0f6b87ef806c604138..7ce3d9d9da53534a81431e1730bdf7686d76f76c 100755 (executable)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2011-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2011-2023  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 Python script for HOMARD
 Test test_3
 """
-__revision__ = "V4.04"
+__revision__ = "V4.06"
 
 #========================================================================
 TEST_NAME = "test_3"
 DEBUG = False
-N_BOUCLE = 2
 N_ITER_TEST_FILE = 2
+N_BOUCLE = 2
 #========================================================================
 import os
 import sys
@@ -47,14 +47,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
   """
@@ -62,7 +62,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+  #  HOMARD.UpdateStudy()
   #
   # Creation of the boundaries
   # ==========================
@@ -144,7 +144,7 @@ Python script for HOMARD
       print("-------- Creation of the schema", yacsname)
       yacs_test_3 = case_test_3.CreateYACSSchema(yacsname, scriptfile, dirname, mesh_file)
       yacs_test_3.SetType(2)
-      yacs_test_3.SetMaxIter(2)
+      yacs_test_3.SetMaxIter(N_ITER_TEST_FILE)
       error = yacs_test_3.Write()
       if error :
         error = 10*num + 5
@@ -199,7 +199,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:
@@ -212,6 +212,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)