diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-05 20:56:47 -0400 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-05 20:56:47 -0400 |
commit | 724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c (patch) | |
tree | 41cc372eb5897b95d3c08c733e82fd7241eb9524 /gerber/tests/test_primitives.py | |
parent | 5af19af190c1fb0f0c5be029d46d63e657dde4d9 (diff) | |
download | gerbonara-724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c.tar.gz gerbonara-724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c.tar.bz2 gerbonara-724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c.zip |
Finish Merge, most tests passing
Diffstat (limited to 'gerber/tests/test_primitives.py')
-rw-r--r-- | gerber/tests/test_primitives.py | 28 |
1 files changed, 14 insertions, 14 deletions
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)) |