2 # execute run procedure as Python macro for testing
7 from com
.sun
.star
.awt
.FontSlant
import ITALIC
8 from com
.sun
.star
.awt
.FontSlant
import NONE
9 from com
.sun
.star
.uno
.TypeClass
import STRING
10 from com
.sun
.star
.uno
.TypeClass
import LONG
11 from com
.sun
.star
.awt
import Point
13 class Test124953(unittest
.TestCase
):
16 italic
= uno
.Enum("com.sun.star.awt.FontSlant", "ITALIC")
17 none_
= uno
.Enum("com.sun.star.awt.FontSlant", "NONE")
18 self
.assertEqual(ITALIC
, ITALIC
)
19 self
.assertEqual(ITALIC
, italic
)
20 self
.assertFalse((ITALIC
!= italic
))
21 self
.assertNotEqual(ITALIC
, NONE
)
22 self
.assertEqual(NONE
, none_
)
26 STRING_TYPE
= uno
.getTypeByName("string")
27 LONG_TYPE
= uno
.getTypeByName("long")
28 string_type
= uno
.Type("string", STRING
)
29 long_type
= uno
.Type("long", LONG
)
30 self
.assertEqual(STRING_TYPE
, STRING_TYPE
)
31 self
.assertEqual(STRING_TYPE
, string_type
)
32 self
.assertFalse((STRING_TYPE
!= string_type
))
33 self
.assertNotEqual(STRING_TYPE
, LONG
)
34 self
.assertEqual(LONG_TYPE
, long_type
)
37 char_a
= uno
.Char("a")
38 char_a2
= uno
.Char("a")
39 char_b
= uno
.Char("b")
40 self
.assertEqual(char_a
, char_a
)
41 self
.assertEqual(char_a
, char_a2
)
42 self
.assertFalse((char_a
!= char_a2
))
43 self
.assertNotEqual(char_a
, char_b
)
45 def test_ByteSequence(self
):
46 b1
= uno
.ByteSequence(bytes("abcdefg", encoding
="utf8"))
47 b2
= uno
.ByteSequence(bytes("abcdefg", encoding
="utf8"))
48 b3
= uno
.ByteSequence(bytes("1234567", encoding
="utf8"))
49 self
.assertEqual(b1
, b1
)
50 self
.assertEqual(b1
, b2
)
51 self
.assertFalse(b1
!= b2
)
52 self
.assertNotEqual(b1
, b3
)
54 def test_Struct(self
):
55 point1
= Point(100, 200)
56 point2
= Point(100, 200)
58 self
.assertEqual(point1
, point1
)
59 self
.assertEqual(point1
, point2
)
60 self
.assertFalse((point1
!= point2
))
61 self
.assertNotEqual(point1
, point3
)