Salome HOME
Passage des cas-tests en français
authornicolas <nicolas>
Mon, 4 Nov 2013 10:03:40 +0000 (10:03 +0000)
committernicolas <nicolas>
Mon, 4 Nov 2013 10:03:40 +0000 (10:03 +0000)
tests/CMakeLists.txt
tests/test_1.py
tests/test_2.py
tests/test_3.py
tests/test_util.py [new file with mode: 0755]

index 8fc65a120edcc091409990087714c324fb0a1b0b..19e572ba0ab6efb598ebca38bcda6baf0db68a65 100755 (executable)
@@ -21,6 +21,7 @@
 #
 
 SET(HOMARD_TEST_FILES
+  test_util.py
   test_1.pdf
   test_1.en.pdf
   test_1.py
index 17e5eb1b15f29f88a129be779dbe9acba351078f..873b9cb8cd5a03c3be17545e44d4064a4633a95a 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2010, 2013
 Test test_1
 """
-__revision__ = "V1.13"
+__revision__ = "V2.1"
 
 #========================================================================
 Test_Name = "test_1"
@@ -30,6 +30,7 @@ n_iter_test_file = 3
 #========================================================================
 import os
 import tempfile
+import sys
 import HOMARD
 import salome
 #
@@ -39,28 +40,13 @@ Rep_Test = os.path.normpath(Rep_Test)
 Rep_Test_Resu = tempfile.mktemp()
 os.mkdir(Rep_Test_Resu)
 
+sys.path.append(Rep_Test)
+from test_util import remove_dir
+
 salome.salome_init()
 import iparameters
 ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
 ipar.append("AP_MODULES_LIST", "Homard")
-#========================================================================
-#========================================================================
-def remove_dir(directory) :
-  """
-Empties, then removes a directory.
-Copyright EDF-R&D 2013
-  """
-#
-  l_aux = os.listdir(directory)
-  for fic in l_aux :
-    fic_a = os.path.join(directory, fic)
-    if os.path.isdir(fic_a) :
-      remove_dir(fic_a)
-    else :
-      os.remove(fic_a)
-  os.rmdir(directory)
-#
-  return
 #
 #========================================================================
 #========================================================================
@@ -197,6 +183,7 @@ Copyright EDF-R&D 2010, 2013
 
 homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
 
 #
 # Exec of HOMARD-SALOME
index 8633102f7b95dadcb1d9161711d4a286f692c20f..987a5c9e1fdfb22bd09f6970cf821e77d9196d97 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2010, 2013
 Test test_2
 """
-__revision__ = "V1.12"
+__revision__ = "V2.1"
 
 #========================================================================
 Test_Name = "test_2"
@@ -30,6 +30,7 @@ n_iter_test_file = 3
 #========================================================================
 import os
 import tempfile
+import sys
 import HOMARD
 import salome
 #
@@ -39,28 +40,13 @@ Rep_Test = os.path.normpath(Rep_Test)
 Rep_Test_Resu = tempfile.mktemp()
 os.mkdir(Rep_Test_Resu)
 
+sys.path.append(Rep_Test)
+from test_util import remove_dir
+
 salome.salome_init()
 import iparameters
 ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
 ipar.append("AP_MODULES_LIST", "Homard")
-#========================================================================
-#========================================================================
-def remove_dir(directory) :
-  """
-Empties, then removes a directory.
-Copyright EDF-R&D 2013
-  """
-#
-  l_aux = os.listdir(directory)
-  for fic in l_aux :
-    fic_a = os.path.join(directory, fic)
-    if os.path.isdir(fic_a) :
-      remove_dir(fic_a)
-    else :
-      os.remove(fic_a)
-  os.rmdir(directory)
-#
-  return
 #
 #========================================================================
 #========================================================================
@@ -173,6 +159,7 @@ Copyright EDF-R&D 2010, 2013
 
 homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
 #
 # Exec of HOMARD-SALOME
 #
index 1277520cf1a5ff1f819fc0b627ab63bd92114c34..6507a58b1b68c70fe1744e0d72e3620f33c466b6 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2011, 2013
 Test test_3
 """
-__revision__ = "V1.12"
+__revision__ = "V2.1"
 
 #========================================================================
 Test_Name = "test_3"
@@ -31,6 +31,7 @@ n_iter_test_file = 2
 #========================================================================
 import os
 import tempfile
+import sys
 import HOMARD
 import salome
 #
@@ -40,28 +41,13 @@ Rep_Test = os.path.normpath(Rep_Test)
 Rep_Test_Resu = tempfile.mktemp()
 os.mkdir(Rep_Test_Resu)
 
+sys.path.append(Rep_Test)
+from test_util import remove_dir
+
 salome.salome_init()
 import iparameters
 ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
 ipar.append("AP_MODULES_LIST", "Homard")
-#========================================================================
-#========================================================================
-def remove_dir(directory) :
-  """
-Empties, then removes a directory.
-Copyright EDF-R&D 2013
-  """
-#
-  l_aux = os.listdir(directory)
-  for fic in l_aux :
-    fic_a = os.path.join(directory, fic)
-    if os.path.isdir(fic_a) :
-      remove_dir(fic_a)
-    else :
-      os.remove(fic_a)
-  os.rmdir(directory)
-#
-  return
 #
 #========================================================================
 #========================================================================
@@ -207,6 +193,7 @@ Copyright EDF-R&D 2010, 2013
 
 homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert homard is not None, "Impossible to load homard engine"
+homard.SetLanguageShort("fr")
 #
 # Exec of HOMARD-SALOME
 #
diff --git a/tests/test_util.py b/tests/test_util.py
new file mode 100755 (executable)
index 0000000..2e6b0f5
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+"""
+Python script for HOMARD
+Copyright EDF-R&D 2013
+Test test_1
+"""
+__revision__ = "V1.0"
+
+import os
+#========================================================================
+#========================================================================
+def remove_dir(directory) :
+  """
+Empties, then removes a directory.
+Copyright EDF-R&D 2013
+  """
+#
+  l_aux = os.listdir(directory)
+  for fic in l_aux :
+    fic_a = os.path.join(directory, fic)
+    if os.path.isdir(fic_a) :
+      remove_dir(fic_a)
+    else :
+      os.remove(fic_a)
+  os.rmdir(directory)
+#
+  return
+#
+#========================================================================
+#========================================================================