Salome HOME
b701fbb022b27fc62b7d2dbbe113758c7c2c5a4e
[tools/eficas.git] / Tests / testihm / testihm2.py
1 # -*- coding: utf-8 -*-
2 # Modules Python
3 import os
4 import unittest
5 import difflib
6 import compare
7 import sys
8 import Tkinter
9
10 # Modules Eficas
11 import prefs
12 from Editeur import eficas_go
13 from Editeur import splash
14 from Editeur import session
15 from Editeur import eficas
16 from Editeur import images
17 from common import *
18
19
20 class TestCase(unittest.TestCase):
21     def setUp(self):
22         self.root = Tkinter.Tk()
23         images.update_cache()
24         # Analyse des arguments de la ligne de commande
25         options=session.parse([])
26         options.cata="v8"
27         pass
28
29     def tearDown(self):
30         self.root.destroy()
31         init_common(None,None)
32         pass
33
34     def test000(self):
35         root=self.root
36         code="ASTER"
37         splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code)
38         splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...")
39         app=eficas.EFICAS(root,code=code)
40         j=app.bureau.newJDC()
41         jdcdisplay=app.bureau.JDCDisplay_courant
42         init_common(root,jdcdisplay)
43
44         # commande DEBUT
45         co=j.addentite("DEBUT",0)
46         # commande FIN
47         co=j.addentite("FIN",1)
48
49         jdctree=jdcdisplay.tree.tree.children[0]
50         panel=select_child("DEBUT",jdctree)
51         panel=create_command("LIRE_MAILLAGE",panel)
52         panel=nomme_concept("MA",panel)
53
54         panel=create_command("AFFE_MODELE",panel)
55         command=panel.node
56         select_child("MAILLAGE",command)
57         panel=select_node(command)
58         panel=create_mocle("AFFE",panel)
59         parent=panel.node
60         panel=select_child("PHENOMENE",parent)
61         choose_valeur("MECANIQUE",panel)
62         panel=select_child("b_mecanique",parent)
63         panel=select_child("MODELISATION",panel.node)
64         add_valeur_into("3D",panel)
65         add_valeur_into("3D_FLUIDE",panel)
66         valider_valeur(panel)
67         panel=select_node(parent)
68         panel=create_mocle("TOUT",panel)
69         choose_valeur("OUI",panel)
70         panel=select_node(command)
71         panel=nomme_concept("MO",panel)
72
73         assert j.isvalid(),j.report()