From 724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sat, 5 Nov 2016 20:56:47 -0400 Subject: Finish Merge, most tests passing --- gerber/tests/test_primitives.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'gerber/tests/test_primitives.py') diff --git a/gerber/tests/test_primitives.py b/gerber/tests/test_primitives.py index c49b558..9aeec68 100644 --- a/gerber/tests/test_primitives.py +++ b/gerber/tests/test_primitives.py @@ -13,17 +13,17 @@ def test_primitive_smoketest(): try: p.bounding_box assert_false(True, 'should have thrown the exception') - except NotImplementedError: + except NotImplementedError: pass #assert_raises(NotImplementedError, p.bounding_box) p.to_metric() p.to_inch() - try: - p.offset(1, 1) - assert_false(True, 'should have thrown the exception') - except NotImplementedError: - pass + #try: + # p.offset(1, 1) + # assert_false(True, 'should have thrown the exception') + #except NotImplementedError: + # pass def test_line_angle(): @@ -291,7 +291,7 @@ def test_circle_conversion(): assert_equal(c.position, (0.1, 1.)) assert_equal(c.diameter, 10.) assert_equal(c.hole_diameter, None) - + # Circle initially metric, with hole c = Circle((2.54, 25.4), 254.0, 127.0, units='metric') @@ -310,7 +310,7 @@ def test_circle_conversion(): assert_equal(c.position, (0.1, 1.)) assert_equal(c.diameter, 10.) assert_equal(c.hole_diameter, 5.) - + # Circle initially inch, no hole c = Circle((0.1, 1.0), 10.0, units='inch') # No effect @@ -437,13 +437,13 @@ def test_rectangle_ctor(): assert_equal(r.position, pos) assert_equal(r.width, width) assert_equal(r.height, height) - + def test_rectangle_hole_radius(): """ Test rectangle hole diameter calculation """ r = Rectangle((0,0), 2, 2) assert_equal(0, r.hole_radius) - + r = Rectangle((0,0), 2, 2, 1) assert_equal(0.5, r.hole_radius) @@ -464,7 +464,7 @@ def test_rectangle_bounds(): def test_rectangle_conversion(): """Test converting rectangles between units""" - + # Initially metric no hole r = Rectangle((2.54, 25.4), 254.0, 2540.0, units='metric') @@ -482,7 +482,7 @@ def test_rectangle_conversion(): assert_equal(r.position, (0.1, 1.0)) assert_equal(r.width, 10.0) assert_equal(r.height, 100.0) - + # Initially metric with hole r = Rectangle((2.54, 25.4), 254.0, 2540.0, 127.0, units='metric') @@ -520,7 +520,7 @@ def test_rectangle_conversion(): assert_equal(r.position, (2.54, 25.4)) assert_equal(r.width, 254.0) assert_equal(r.height, 2540.0) - + # Initially inch with hole r = Rectangle((0.1, 1.0), 10.0, 100.0, 5.0, units='inch') r.to_inch() @@ -903,7 +903,7 @@ def test_polygon_bounds(): def test_polygon_conversion(): p = Polygon((2.54, 25.4), 3, 254.0, 0, units='metric') - + # No effect p.to_metric() assert_equal(p.position, (2.54, 25.4)) -- cgit