2 # -*- coding: utf-8 -*-
4 # %% LICENSE_SALOME_CEA_BEGIN
5 # Copyright (C) 2008-2016 CEA/DEN
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org or email : webmaster.salome@opencascade.com
33 class TestCase(unittest.TestCase):
36 self.assertEqual(TM.okToSys([]), TM.KOSYS)
37 self.assertEqual(TM.okToSys([[]]), TM.KOSYS)
39 res = TM.OK + " blah blah 0"
40 self.assertEqual(TM.okToSys([[res]]), TM.OKSYS)
41 self.assertEqual(TM.okToSys(res), TM.OKSYS)
43 self.assertEqual(TM.okToSys(res), TM.OKSYS)
44 res.append(TM.OK + " blah blah 1")
45 self.assertEqual(TM.okToSys(res), TM.OKSYS)
46 res.append([TM.OK + " blah blah 2"])
47 self.assertEqual(TM.okToSys(res), TM.OKSYS)
48 res.append([TM.KO + " blah blah 3"])
49 self.assertEqual(TM.okToSys(res), TM.KOSYS)
50 self.assertEqual(TM.okToSys([]), TM.KOSYS)
51 res = [[[res]], [TM.OK + " blah blah 4"], []]
52 self.assertEqual(TM.okToSys(res), TM.KOSYS)
55 a = TM.XXVert(1, 1, 1)
56 b = TM.XXVert(2, 2, 2)
57 c = TM.XXVert(1., 1., 1., 3, 4)
58 self.assertEqual(a == c, True)
60 from argparse import Namespace
61 args = Namespace(withColor=True, withIndex=True)
62 self.assertEqual(a.compare(c, args, withAll=True), False)
63 self.assertEqual(a.compare(c, args, withAll=False), True)
65 args = Namespace(withColor=False, withIndex=False)
66 self.assertEqual(a.compare(c, args, withAll=True), True)
68 self.assertEqual(a == b, False)
69 self.assertEqual(a.dist(b), 3 ** .5)
71 self.assertEqual(str(c), '(1.0 1.0 1.0 (3 4))')
72 self.assertEqual(c.__repr__(), 'XXVert(1.0000 1.0000 1.0000 (3 4))')
75 if __name__ == '__main__':