diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2017-11-14 09:11:49 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2017-11-14 09:11:49 -0500 |
commit | ca6c819ca8ee6dbce04c50a1d1e9f6ed63e07880 (patch) | |
tree | ddc96865193292bad6a56935db4902c18b707545 /gerber/tests | |
parent | e12a04fc16fd3c43a1353658a528ac8325ef42bb (diff) | |
download | gerbonara-ca6c819ca8ee6dbce04c50a1d1e9f6ed63e07880.tar.gz gerbonara-ca6c819ca8ee6dbce04c50a1d1e9f6ed63e07880.tar.bz2 gerbonara-ca6c819ca8ee6dbce04c50a1d1e9f6ed63e07880.zip |
Add test that reproduces #77
Diffstat (limited to 'gerber/tests')
-rw-r--r-- | gerber/tests/test_primitives.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gerber/tests/test_primitives.py b/gerber/tests/test_primitives.py index 2fe5a4b..b932297 100644 --- a/gerber/tests/test_primitives.py +++ b/gerber/tests/test_primitives.py @@ -1343,3 +1343,17 @@ def test_drill_equality(): assert_equal(d, d1) d1 = Drill((2.54, 25.4), 254.2) assert_not_equal(d, d1) + + +def test_slot_bounds(): + """ Test Slot primitive bounding box calculation + """ + cases = [((0, 0), (1, 1), ((-1, 2), (-1, 2))), + ((-1, -1), (1, 1), ((-2, 2), (-2, 2))), + ((1, 1), (-1, -1), ((-2, 2), (-2, 2))), + ((-1, 1), (1, -1), ((-2, 2), (-2, 2))), ] + + for start, end, expected in cases: + s = Slot(start, end, 2.0) + assert_equal(s.bounding_box, expected) + |