nss: upgrade to release 3.73
[LibreOffice.git] / pyuno / qa / pytests / testcollections_misc2.py
blobb696e050a53d91b67ae684cf3684d1f89b5dfab5
2 # execute run procedure as Python macro for testing
4 import uno
5 import sys
6 import unittest
8 from com.sun.star.awt.FontSlant import ITALIC
9 from com.sun.star.awt.FontSlant import NONE
10 from com.sun.star.uno.TypeClass import STRING
11 from com.sun.star.uno.TypeClass import LONG
12 from com.sun.star.awt import Point
14 class Test124953(unittest.TestCase):
16 def test_Enum(self):
17 italic = uno.Enum("com.sun.star.awt.FontSlant", "ITALIC")
18 none_ = uno.Enum("com.sun.star.awt.FontSlant", "NONE")
19 self.assertEqual(ITALIC, ITALIC)
20 self.assertEqual(ITALIC, italic)
21 self.assertFalse((ITALIC != italic))
22 self.assertNotEqual(ITALIC, NONE)
23 self.assertEqual(NONE, none_)
25 def test_Type(self):
27 STRING_TYPE = uno.getTypeByName("string")
28 LONG_TYPE = uno.getTypeByName("long")
29 string_type = uno.Type("string", STRING)
30 long_type = uno.Type("long", LONG)
31 self.assertEqual(STRING_TYPE, STRING_TYPE)
32 self.assertEqual(STRING_TYPE, string_type)
33 self.assertFalse((STRING_TYPE != string_type))
34 self.assertNotEqual(STRING_TYPE, LONG)
35 self.assertEqual(LONG_TYPE, long_type)
37 def test_Char(self):
38 char_a = uno.Char("a")
39 char_a2 = uno.Char("a")
40 char_b = uno.Char("b")
41 self.assertEqual(char_a, char_a)
42 self.assertEqual(char_a, char_a2)
43 self.assertFalse((char_a != char_a2))
44 self.assertNotEqual(char_a, char_b)
46 def test_ByteSequence(self):
47 b1 = uno.ByteSequence(bytes("abcdefg", encoding="utf8"))
48 b2 = uno.ByteSequence(bytes("abcdefg", encoding="utf8"))
49 b3 = uno.ByteSequence(bytes("1234567", encoding="utf8"))
50 self.assertEqual(b1, b1)
51 self.assertEqual(b1, b2)
52 self.assertFalse(b1 != b2)
53 self.assertNotEqual(b1, b3)
55 def test_Struct(self):
56 point1 = Point(100, 200)
57 point2 = Point(100, 200)
58 point3 = Point(0, 10)
59 self.assertEqual(point1, point1)
60 self.assertEqual(point1, point2)
61 self.assertFalse((point1 != point2))
62 self.assertNotEqual(point1, point3)