diff options
author | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-07-14 13:32:17 -0300 |
---|---|---|
committer | Paulo Henrique Silva <ph.silva@gmail.com> | 2015-07-14 13:32:17 -0300 |
commit | c92d2d9ea2853fd22b5ff51f211b03b4e660c551 (patch) | |
tree | 5bca9d6f4389b2d3d93388800552f7e3ea924bfb /gerber/tests | |
parent | 1a70064e1097b90215e9f58b36cb31520d650eee (diff) | |
parent | 15254a5bb7ad866e09374c5a99e9be4468e4d3c7 (diff) | |
download | gerbonara-c92d2d9ea2853fd22b5ff51f211b03b4e660c551.tar.gz gerbonara-c92d2d9ea2853fd22b5ff51f211b03b4e660c551.tar.bz2 gerbonara-c92d2d9ea2853fd22b5ff51f211b03b4e660c551.zip |
Merge pull request #31 from curtacircuitos/statement_link
Add support for tool reordering and drill path optimization example.
Diffstat (limited to 'gerber/tests')
-rw-r--r-- | gerber/tests/test_excellon.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gerber/tests/test_excellon.py b/gerber/tests/test_excellon.py index d47ad6a..006277d 100644 --- a/gerber/tests/test_excellon.py +++ b/gerber/tests/test_excellon.py @@ -24,6 +24,17 @@ def test_read(): ncdrill = read(NCDRILL_FILE) assert(isinstance(ncdrill, ExcellonFile)) +def test_write(): + ncdrill = read(NCDRILL_FILE) + ncdrill.write('test.ncd') + with open(NCDRILL_FILE) as src: + srclines = src.readlines() + + with open('test.ncd') as res: + for idx, line in enumerate(res): + assert_equal(line.strip(), srclines[idx].strip()) + os.remove('test.ncd') + def test_read_settings(): ncdrill = read(NCDRILL_FILE) assert_equal(ncdrill.settings['format'], (2, 4)) @@ -47,9 +58,11 @@ def test_conversion(): ncdrill.to_metric() assert_equal(ncdrill.settings.units, 'metric') + inch_primitives = ncdrill_inch.primitives + for tool in iter(ncdrill_inch.tools.values()): tool.to_metric() - for primitive in ncdrill_inch.primitives: + for primitive in inch_primitives: primitive.to_metric() for statement in ncdrill_inch.statements: statement.to_metric() @@ -57,7 +70,7 @@ def test_conversion(): for m_tool, i_tool in zip(iter(ncdrill.tools.values()), iter(ncdrill_inch.tools.values())): assert_equal(i_tool, m_tool) - for m, i in zip(ncdrill.primitives,ncdrill_inch.primitives): + for m, i in zip(ncdrill.primitives,inch_primitives): assert_equal(m, i) |