Salome HOME
modif Adao 7 6
[tools/eficas.git] / Tests / testelem / testsimp0.py
1 from Noyau import SIMP
2
3 import unittest
4
5 class TestSimpCase(unittest.TestCase):
6    def testStatut1(self):
7       a=SIMP(typ='I',statut='o')
8       cr=a.report()
9       self.assert_(cr.estvide())
10
11    def testStatut2(self):
12       a=SIMP(typ='I')
13       cr=a.report()
14       self.assert_(cr.estvide())
15
16    def testStatut3(self):
17       a=SIMP(typ='I',statut='s')
18       cr=a.report()
19       expected_cr="""
20    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21    ! L'attribut 'statut' doit valoir 'o','f','c' ou 'd' : 's' !
22    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23
24 """
25       self.assertEqual(str(cr) , expected_cr)
26
27    def testPosition1(self):
28       a=SIMP(typ='I',position='total')
29       cr=a.report()
30       expected_cr="""
31    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32    ! L'attribut 'position' doit valoir 'local','global' ou 'global_jdc' : 'total' !
33    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34
35 """
36       self.assertEqual(str(cr) , expected_cr)
37
38    def testMinMax1(self):
39       a=SIMP(typ='I',min='**',max=12)
40       cr=a.report()
41       expected_cr="""
42    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43    ! Nombres d'occurrence min et max invalides : '**' 12 !
44    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45
46 """
47       self.assertEqual(str(cr) , expected_cr)