-
Notifications
You must be signed in to change notification settings - Fork 15
/
test_generate_qfn.py
49 lines (45 loc) · 1.46 KB
/
test_generate_qfn.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
import pytest
import generate_qfp
@pytest.mark.parametrize(['pad_number', 'pad_count', 'pitch', 'offset', 'x', 'y'], [
# Square, odd number of pads per side
(1, 20, 2.54, 8.0, -8.0, 5.08),
(2, 20, 2.54, 8.0, -8.0, 2.54),
(3, 20, 2.54, 8.0, -8.0, 0.0),
(4, 20, 2.54, 8.0, -8.0, -2.54),
(5, 20, 2.54, 8.0, -8.0, -5.08),
(6, 20, 2.54, 8.0, -5.08, -8.0),
(7, 20, 2.54, 8.0, -2.54, -8.0),
(8, 20, 2.54, 8.0, 0.0, -8.0),
(9, 20, 2.54, 8.0, 2.54, -8.0),
(10, 20, 2.54, 8.0, 5.08, -8.0),
(11, 20, 2.54, 8.0, 8.0, -5.08),
(12, 20, 2.54, 8.0, 8.0, -2.54),
(13, 20, 2.54, 8.0, 8.0, 0.0),
(14, 20, 2.54, 8.0, 8.0, 2.54),
(15, 20, 2.54, 8.0, 8.0, 5.08),
(16, 20, 2.54, 8.0, 5.08, 8.0),
(17, 20, 2.54, 8.0, 2.54, 8.0),
(18, 20, 2.54, 8.0, 0.0, 8.0),
(19, 20, 2.54, 8.0, -2.54, 8.0),
(20, 20, 2.54, 8.0, -5.08, 8.0),
# Square, even number of pads per side
(1, 16, 4.0, 12.0, -12.0, 6.0),
(2, 16, 4.0, 12.0, -12.0, 2.0),
(3, 16, 4.0, 12.0, -12.0, -2.0),
(4, 16, 4.0, 12.0, -12.0, -6.0),
(5, 16, 4.0, 12.0, -6.0, -12.0),
(6, 16, 4.0, 12.0, -2.0, -12.0),
(7, 16, 4.0, 12.0, 2.0, -12.0),
(8, 16, 4.0, 12.0, 6.0, -12.0),
])
def test_get_pad_coords(
pad_number: int,
pad_count: int,
pitch: float,
offset: float,
x: float,
y: float,
) -> None:
result = generate_qfp.get_pad_coords(pad_number, pad_count, pitch, offset)
assert result.x == x
assert result.y == y