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