From 25c4e5ca1a244983367548678558e08d0182cf17 Mon Sep 17 00:00:00 2001 From: nicolas Date: Mon, 4 Nov 2013 10:03:40 +0000 Subject: [PATCH] =?utf8?q?Passage=20des=20cas-tests=20en=20fran=C3=83?= =?utf8?q?=C2=A7ais?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tests/CMakeLists.txt | 1 + tests/test_1.py | 25 ++++++----------------- tests/test_2.py | 25 ++++++----------------- tests/test_3.py | 25 ++++++----------------- tests/test_util.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 57 deletions(-) create mode 100755 tests/test_util.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8fc65a12..19e572ba 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,6 +21,7 @@ # SET(HOMARD_TEST_FILES + test_util.py test_1.pdf test_1.en.pdf test_1.py diff --git a/tests/test_1.py b/tests/test_1.py index 17e5eb1b..873b9cb8 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -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 diff --git a/tests/test_2.py b/tests/test_2.py index 8633102f..987a5c9e 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -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 # diff --git a/tests/test_3.py b/tests/test_3.py index 1277520c..6507a58b 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -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 index 00000000..2e6b0f55 --- /dev/null +++ b/tests/test_util.py @@ -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 +# +#======================================================================== +#======================================================================== -- 2.39.2