summaryrefslogtreecommitdiff
path: root/gerber/tests/test_excellon.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2017-07-04 02:11:52 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2017-07-04 02:11:52 -0400
commit7ad6c3f6acfe1fe995c9f087e7ef7a51add60afe (patch)
tree45a5121abd6753172239aa7249e0890ee1d91319 /gerber/tests/test_excellon.py
parentea0643dcf45e3841c8d8d9e038293cb2eff75792 (diff)
downloadgerbonara-7ad6c3f6acfe1fe995c9f087e7ef7a51add60afe.tar.gz
gerbonara-7ad6c3f6acfe1fe995c9f087e7ef7a51add60afe.tar.bz2
gerbonara-7ad6c3f6acfe1fe995c9f087e7ef7a51add60afe.zip
Fix handling of multi-line strings per #66
Diffstat (limited to 'gerber/tests/test_excellon.py')
-rw-r--r--gerber/tests/test_excellon.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/gerber/tests/test_excellon.py b/gerber/tests/test_excellon.py
index 6cddb60..d17791c 100644
--- a/gerber/tests/test_excellon.py
+++ b/gerber/tests/test_excellon.py
@@ -7,7 +7,7 @@ import os
from ..cam import FileSettings
from ..excellon import read, detect_excellon_format, ExcellonFile, ExcellonParser
from ..excellon import DrillHit, DrillSlot
-from ..excellon_statements import ExcellonTool
+from ..excellon_statements import ExcellonTool, RouteModeStmt
from .tests import *
@@ -127,7 +127,7 @@ def test_parse_header():
def test_parse_rout():
p = ExcellonParser(FileSettings())
- p._parse_line('G00 ')
+ p._parse_line('G00X040944Y019842')
assert_equal(p.state, 'ROUT')
p._parse_line('G05 ')
assert_equal(p.state, 'DRILL')
@@ -336,4 +336,25 @@ def test_drill_slot_bounds():
assert_equal(slot.bounding_box, expected)
-#def test_exce
+def test_handling_multi_line_g00_and_g1():
+ """Route Mode statements with coordinates on separate line are handled
+ """
+ test_data = """
+%
+M48
+M72
+T01C0.0236
+%
+T01
+G00
+X040944Y019842
+M15
+G01
+X040944Y020708
+M16
+"""
+ uut = ExcellonParser()
+ uut.parse_raw(test_data)
+ assert_equal(len([stmt for stmt in uut.statements
+ if isinstance(stmt, RouteModeStmt)]), 2)
+