1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2008-2024 EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
22 "COMM/TUI/SCD/YACS: Conversion utilities verification"
28 fichiers = glob.glob("*.comm")+glob.glob("snippets*_Convert_XXX_to_YYY/*.comm")
30 # ==============================================================================
31 class Test_Adao(unittest.TestCase):
35 Conversion utilities verification (COM->SCD)
36 ++++++++++++++++++++++++++++++++++++++++++++
40 from adao import adaoBuilder
42 for fichier in fichiers:
43 basename = fichier.rstrip(".comm")
45 print(" Processing \"%s\""%basename)
46 with open(basename+".comm") as fid:
47 comm_content = fid.read()
49 comm_content = comm_content.replace("test001_ADAO_External_variables", "test914_Xternal_3_Variables")
50 comm_content = comm_content.replace("test020_Observation_and_Simulation", "test914_Xternal_4_Variables")
51 comm_content = comm_content.replace("test033_ADAO_Elementary_FunctionTest_Operators", "test914_Xternal_5_Variables")
53 case = adaoBuilder.New()
54 case.load( Content=comm_content, Formater="COM" )
55 texte = case.dump(Formater="SCD")
58 print(" ---> Ok, SCD file of COMM conversion is correct\n")
60 # ==============================================================================
61 if __name__ == '__main__':
62 print("\nAUTODIAGNOSTIC\n==============")
63 sys.stderr = sys.stdout
64 unittest.main(verbosity=2)