diff options
Diffstat (limited to 'gerber/tests')
-rw-r--r-- | gerber/tests/test_gerber_statements.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gerber/tests/test_gerber_statements.py b/gerber/tests/test_gerber_statements.py index f3249b1..b5c20b1 100644 --- a/gerber/tests/test_gerber_statements.py +++ b/gerber/tests/test_gerber_statements.py @@ -635,6 +635,24 @@ def test_ADParamStmt_factory(): assert_equal(ad.d, 1) assert_equal(ad.shape, 'R') + stmt = {'param': 'AD', 'd': 1, 'shape': 'C', "modifiers": "1.42"} + ad = ADParamStmt.from_dict(stmt) + assert_equal(ad.d, 1) + assert_equal(ad.shape, 'C') + assert_equal(ad.modifiers, [(1.42,)]) + + stmt = {'param': 'AD', 'd': 1, 'shape': 'C', "modifiers": "1.42X"} + ad = ADParamStmt.from_dict(stmt) + assert_equal(ad.d, 1) + assert_equal(ad.shape, 'C') + assert_equal(ad.modifiers, [(1.42,)]) + + stmt = {'param': 'AD', 'd': 1, 'shape': 'R', "modifiers": "1.42X1.24"} + ad = ADParamStmt.from_dict(stmt) + assert_equal(ad.d, 1) + assert_equal(ad.shape, 'R') + assert_equal(ad.modifiers, [(1.42, 1.24)]) + def test_ADParamStmt_conversion(): stmt = {'param': 'AD', 'd': 0, 'shape': 'C', 'modifiers': '25.4X25.4,25.4X25.4'} ad = ADParamStmt.from_dict(stmt) |