diff options
author | Paulo Henrique Silva <ph.silva@gmail.com> | 2016-11-16 23:54:09 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 23:54:09 -0200 |
commit | 521fe89150c6aaa0ff0954cc8d32e4b6f8009324 (patch) | |
tree | 59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/tests/test_am_statements.py | |
parent | 7030eee5e28180732c5cf98aeda4b66657223870 (diff) | |
parent | 1e868763a1c4030bedd51553468cbe25f272bef9 (diff) | |
download | gerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.tar.gz gerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.tar.bz2 gerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.zip |
Merge pull request #58 from garretfick/merge-curtacircuitos
Epic merge from @garretfick
Thanks a lot @garretfick and @hamiltonkibbe.
Diffstat (limited to 'gerber/tests/test_am_statements.py')
-rw-r--r-- | gerber/tests/test_am_statements.py | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/gerber/tests/test_am_statements.py b/gerber/tests/test_am_statements.py index 8c95e6a..c97556a 100644 --- a/gerber/tests/test_am_statements.py +++ b/gerber/tests/test_am_statements.py @@ -160,7 +160,11 @@ def test_AMOutlinePrimitive_factory(): def test_AMOUtlinePrimitive_dump(): o = AMOutlinePrimitive(4, 'on', (0, 0), [(3, 3), (3, 0), (0, 0)], 0) - assert_equal(o.to_gerber(), '4,1,3,0,0,3,3,3,0,0,0,0*') + # New lines don't matter for Gerber, but we insert them to make it easier to remove + # For test purposes we can ignore them + assert_equal(o.to_gerber().replace('\n', ''), '4,1,3,0,0,3,3,3,0,0,0,0*') + + def test_AMOutlinePrimitive_conversion(): @@ -253,33 +257,40 @@ def test_AMMoirePrimitive_conversion(): def test_AMThermalPrimitive_validation(): - assert_raises(ValueError, AMThermalPrimitive, 8, (0.0, 0.0), 7, 5, 0.2) - assert_raises(TypeError, AMThermalPrimitive, 7, (0.0, '0'), 7, 5, 0.2) + assert_raises(ValueError, AMThermalPrimitive, 8, (0.0, 0.0), 7, 5, 0.2, 0.0) + assert_raises(TypeError, AMThermalPrimitive, 7, (0.0, '0'), 7, 5, 0.2, 0.0) + + def test_AMThermalPrimitive_factory(): - t = AMThermalPrimitive.from_gerber('7,0,0,7,6,0.2*') + t = AMThermalPrimitive.from_gerber('7,0,0,7,6,0.2,45*') assert_equal(t.code, 7) assert_equal(t.position, (0, 0)) assert_equal(t.outer_diameter, 7) assert_equal(t.inner_diameter, 6) assert_equal(t.gap, 0.2) + assert_equal(t.rotation, 45) + + def test_AMThermalPrimitive_dump(): - t = AMThermalPrimitive.from_gerber('7,0,0,7,6,0.2*') - assert_equal(t.to_gerber(), '7,0,0,7.0,6.0,0.2*') + t = AMThermalPrimitive.from_gerber('7,0,0,7,6,0.2,30*') + assert_equal(t.to_gerber(), '7,0,0,7.0,6.0,0.2,30.0*') + + def test_AMThermalPrimitive_conversion(): - t = AMThermalPrimitive(7, (25.4, 25.4), 25.4, 25.4, 25.4) + t = AMThermalPrimitive(7, (25.4, 25.4), 25.4, 25.4, 25.4, 0.0) t.to_inch() assert_equal(t.position, (1., 1.)) assert_equal(t.outer_diameter, 1.) assert_equal(t.inner_diameter, 1.) assert_equal(t.gap, 1.) - t = AMThermalPrimitive(7, (1, 1), 1, 1, 1) + t = AMThermalPrimitive(7, (1, 1), 1, 1, 1, 0) t.to_metric() assert_equal(t.position, (25.4, 25.4)) assert_equal(t.outer_diameter, 25.4) |