summaryrefslogtreecommitdiff
path: root/gerber/tests/test_excellon_statements.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-06 23:54:39 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-06 23:54:39 -0400
commit7f75e8b9e9e338f16f215b2552db9ad9a0a50781 (patch)
tree27480ff5f3e41e98cf5e885fbae5be2a4a336ea4 /gerber/tests/test_excellon_statements.py
parent2abb7159be80beb0565d35e856f3279d2f1f693b (diff)
downloadgerbonara-7f75e8b9e9e338f16f215b2552db9ad9a0a50781.tar.gz
gerbonara-7f75e8b9e9e338f16f215b2552db9ad9a0a50781.tar.bz2
gerbonara-7f75e8b9e9e338f16f215b2552db9ad9a0a50781.zip
add tests
Diffstat (limited to 'gerber/tests/test_excellon_statements.py')
-rw-r--r--gerber/tests/test_excellon_statements.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/gerber/tests/test_excellon_statements.py b/gerber/tests/test_excellon_statements.py
new file mode 100644
index 0000000..3a10153
--- /dev/null
+++ b/gerber/tests/test_excellon_statements.py
@@ -0,0 +1,33 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Author: Hamilton Kibbe <ham@hamiltonkib.be>
+
+from .tests import *
+from ..excellon_statements import *
+
+
+def test_ExcellonTool_factory():
+ """ Test ExcellonTool factory method
+ """
+ exc_line = 'T8F00S00C0.12500'
+ settings = {'format': (2, 5), 'zero_suppression': 'trailing',
+ 'units': 'inch', 'notation': 'absolute'}
+ tool = ExcellonTool.from_excellon(exc_line, settings)
+ assert_equal(tool.diameter, 0.125)
+ assert_equal(tool.feed_rate, 0)
+ assert_equal(tool.rpm, 0)
+
+
+def test_ExcellonTool_dump():
+ """ Test ExcellonTool to_gerber method
+ """
+ exc_lines = ['T1F00S00C0.01200', 'T2F00S00C0.01500', 'T3F00S00C0.01968',
+ 'T4F00S00C0.02800', 'T5F00S00C0.03300', 'T6F00S00C0.03800',
+ 'T7F00S00C0.04300', 'T8F00S00C0.12500', 'T9F00S00C0.13000', ]
+ settings = {'format': (2, 5), 'zero_suppression': 'trailing',
+ 'units': 'inch', 'notation': 'absolute'}
+ for line in exc_lines:
+ tool = ExcellonTool.from_excellon(line, settings)
+ assert_equal(tool.to_excellon(), line)
+ \ No newline at end of file