-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathtest_003_reshaping.py
More file actions
38 lines (26 loc) · 899 Bytes
/
Copy pathtest_003_reshaping.py
File metadata and controls
38 lines (26 loc) · 899 Bytes
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
# -*- coding: utf-8 -*-
import unittest
import sys
import arabic_reshaper
import arabic_reshaper.letters as letters
def _reshaping_test(test):
for i, case in enumerate(test.cases):
def t(): test.assertEqual(case[1], test.reshaper.reshape(case[0]))
if hasattr(test, 'subTest'):
with test.subTest(i=i, case=case[0]):
t()
else:
print('running test case %d' % i, file=sys.stderr)
t()
class TestDefaultReshaping(unittest.TestCase):
def setUp(self):
self.reshaper = arabic_reshaper.default_reshaper
self.cases = (
('چۆمان','ﭼﯚﻣﺎﻥ'),
('گۆیژە','ﮔﯚﯾﮋە'),
('ﺧﯚﻣﺎﻥ ﺧﯚﺵ','ﺧﯚﻣﺎﻥ ﺧﯚﺵ'),
)
def test_reshaping(self):
_reshaping_test(self)
if __name__ == '__main__':
unittest.main()