diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2015-02-15 02:20:02 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2015-02-15 02:20:02 -0500 |
commit | 5cf1fa74b42eb8feaab23078bef6f31f6d647c33 (patch) | |
tree | 5758024d03d41fb9c8010314bbdb4f8f597db333 /gerber/tests/test_primitives.py | |
parent | 5e23d07bcb5103b4607c6ad591a2a547c97ee1f6 (diff) | |
download | gerbonara-5cf1fa74b42eb8feaab23078bef6f31f6d647c33.tar.gz gerbonara-5cf1fa74b42eb8feaab23078bef6f31f6d647c33.tar.bz2 gerbonara-5cf1fa74b42eb8feaab23078bef6f31f6d647c33.zip |
Tests and bugfixes
Diffstat (limited to 'gerber/tests/test_primitives.py')
-rw-r--r-- | gerber/tests/test_primitives.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gerber/tests/test_primitives.py b/gerber/tests/test_primitives.py index 877823d..f8b8620 100644 --- a/gerber/tests/test_primitives.py +++ b/gerber/tests/test_primitives.py @@ -73,20 +73,21 @@ def test_arc_sweep_angle(): ((1, 0), (-1, 0), (0, 0), 'counterclockwise', math.radians(180)),] for start, end, center, direction, sweep in cases: - a = Arc(start, end, center, direction, 0) + c = Circle((0,0), 1) + a = Arc(start, end, center, direction, c) assert_equal(a.sweep_angle, sweep) -# Need to update bounds calculation using aperture -#def test_arc_bounds(): -# """ Test Arc primitive bounding box calculation -# """ -# cases = [((1, 0), (0, 1), (0, 0), 'clockwise', ((-1, 1), (-1, 1))), -# ((1, 0), (0, 1), (0, 0), 'counterclockwise', ((0, 1), (0, 1))), -# #TODO: ADD MORE TEST CASES HERE -# ] -# for start, end, center, direction, bounds in cases: -# a = Arc(start, end, center, direction, 0) -# assert_equal(a.bounding_box, bounds) +def test_arc_bounds(): + """ Test Arc primitive bounding box calculation + """ + cases = [((1, 0), (0, 1), (0, 0), 'clockwise', ((-1.5, 1.5), (-1.5, 1.5))), + ((1, 0), (0, 1), (0, 0), 'counterclockwise', ((-0.5, 1.5), (-0.5, 1.5))), + #TODO: ADD MORE TEST CASES HERE + ] + for start, end, center, direction, bounds in cases: + c = Circle((0,0), 1) + a = Arc(start, end, center, direction, c) + assert_equal(a.bounding_box, bounds) def test_circle_radius(): |