-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_2_keys.py
99 lines (83 loc) · 3.32 KB
/
test_2_keys.py
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# coding=UTF-8
from decimal import Decimal
from kle2xy import KLE2xy
def test_1_00u():
i = KLE2xy('[""],[""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('1')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('9.525')
assert i[1][0]['y'] == Decimal('-28.575')
def test_1_25u():
i = KLE2xy('[""],[{w:1.25},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('1.25')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('11.90625')
assert i[1][0]['y'] == Decimal('-28.575')
def test_1_50u():
i = KLE2xy('[""],[{w:1.5},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('1.5')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('14.2875')
assert i[1][0]['y'] == Decimal('-28.575')
def test_1_75u():
i = KLE2xy('[""],[{w:1.75},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('1.75')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('16.66875')
assert i[1][0]['y'] == Decimal('-28.575')
def test_2_00u():
i = KLE2xy('[""],[{w:2},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('2')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('19.05')
assert i[1][0]['y'] == Decimal('-28.575')
def test_2_25u():
i = KLE2xy('[""],[{w:2.25},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('2.25')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('21.43125')
assert i[1][0]['y'] == Decimal('-28.575')
def test_2_50u():
i = KLE2xy('[""],[{w:2.5},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('2.5')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('23.8125')
assert i[1][0]['y'] == Decimal('-28.575')
def test_2_75u():
i = KLE2xy('[""],[{w:2.75},""]')
assert i[0][0]['width'] == Decimal('1')
assert i[0][0]['height'] == Decimal('1')
assert i[0][0]['x'] == Decimal('9.525')
assert i[0][0]['y'] == Decimal('-9.525')
assert i[1][0]['width'] == Decimal('2.75')
assert i[1][0]['height'] == Decimal('1')
assert i[1][0]['x'] == Decimal('26.19375')
assert i[1][0]['y'] == Decimal('-28.575')