Salome HOME
Merge changes from 'master' branch.
[modules/homard.git] / src / tests / Test / test_5.py
index 27a0f89f8ba7a2b1a046aa96db854b0b56b7c070..439426c02ef8b994aa0f19c1aa8fd115cc1fc963 100755 (executable)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Specific conditions for Code_Saturne
 Test test_5
 """
-__revision__ = "V1.0"
+__revision__ = "V2.01"
 
 #========================================================================
 TEST_NAME = "test_5"
@@ -77,7 +77,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def mesh_exec(theStudy):
+def mesh_exec():
   """
 Python script for MED
   """
@@ -169,7 +169,7 @@ Python script for MED
       meshMEDFile3D.write(ficmed, 2)
     except Exception as eee:
       error = 2
-      raise Exception('ExportToMEDX() failed. '+eee.message)
+      raise Exception('MEDFileUMesh.write() failed. ' + str(eee))
   #
     break
   #
@@ -178,7 +178,7 @@ Python script for MED
 #========================================================================
 #
 #========================================================================
-def field_exec(theStudy, niter):
+def field_exec(niter):
   """
 Python script for MEDCoupling
   """
@@ -233,7 +233,7 @@ Python script for MEDCoupling
 
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -241,7 +241,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the hypothese DISTANCE INVERSE
   # ==========================================
@@ -274,7 +274,7 @@ Python script for HOMARD
     #
     # Creation of the indicator
     #
-      error, ficmed_indic = field_exec(theStudy, niter)
+      error, ficmed_indic = field_exec(niter)
       if error :
         error = 10
         break
@@ -305,11 +305,11 @@ Python script for HOMARD
 # Geometry and Mesh
 #
 try :
-  ERROR = mesh_exec(salome.myStudy)
+  ERROR = mesh_exec()
   if ERROR :
     raise Exception('Pb in mesh_exec')
 except Exception as eee:
-  raise Exception('Pb in mesh_exec: '+eee.message)
+  raise Exception('Pb in mesh_exec: '+str(eee.message))
 
 HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert HOMARD is not None, "Impossible to load homard engine"
@@ -318,11 +318,11 @@ 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 Exception as eee:
-  raise Exception('Pb in homard_exec: '+eee.message)
+  raise Exception('Pb in homard_exec: '+str(eee.message))
 #
 # Test of the results
 #
@@ -331,6 +331,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)