-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
59 lines (46 loc) · 1.98 KB
/
test.py
File metadata and controls
59 lines (46 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import unittest
from toXComposeTools import *
class toXComposeTests(unittest.TestCase):
def test_char2uhex(self):
self.assertEqual(char2uhex(u'→'), 'U2192')
def test_lookup_char(self):
self.assertEqual(lookup_char(u'→'),
(u'→', 'U2192', 'RIGHTWARDS ARROW'))
def test_lookup_uhex(self):
self.assertEqual(lookup_uhex('U2192'),
lookup_char(u'→'))
self.assertEqual(lookup_uhex('U25CB'),
lookup_char(u'○'))
def test_lookup_name(self):
self.assertEqual(lookup_name('RIGHTWARDS ARROW'),
lookup_char(u'→'))
self.assertEqual(lookup_name('WHITE CIRCLE'),
lookup_char(u'○'))
def test_char2xc(self):
self.assertEqual(char2xc(u'→'),
' : "→" U2192 # RIGHTWARDS ARROW')
def test_name2xc(self):
self.assertEqual(name2xc('RIGHTWARDS ARROW'),
' : "→" U2192 # RIGHTWARDS ARROW')
def test_uhex2xc(self):
self.assertEqual(uhex2xc('U2192'),
' : "→" U2192 # RIGHTWARDS ARROW')
def test_lookup_char_internalVSWeb(self):
self.assertEqual(lookup_char(u'→'),
lookup_char_web(u'→'))
def test_char2xc_web(self):
self.assertEqual(char2xc_web(u'→'),
' : "→" U2192 # RIGHTWARDS ARROW')
self.assertEqual(char2xc_web(u''),
' : "" U1D547 # ERR: Name not found')
def test_lookup_uhex_web(self):
self.assertEqual(lookup_uhex_web('U2192'),
lookup_char_web(u'→'))
self.assertEqual(lookup_uhex_web('U25CB'),
lookup_char_web(u'○'))
return 1
def test_uhex2xc_web(self):
self.assertEqual(uhex2xc_web('U2192'),
' : "→" U2192 # RIGHTWARDS ARROW')
if __name__ == '__main__':
unittest.main()