summaryrefslogtreecommitdiff
path: root/gerber/tests
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2016-01-05 22:05:19 -0200
committerPaulo Henrique Silva <ph.silva@gmail.com>2016-01-05 22:05:19 -0200
commit7a532514631384dbfc9d7fc2002cbbfe52433c9f (patch)
tree5678cff7ba877e9c93ea63445f081fd0430f8b4b /gerber/tests
parentaf5541ac93b222c05229ee05c9def8dbae5f6e25 (diff)
parent6a005436b475e3517fd6a583473b60e601bcc661 (diff)
downloadgerbonara-7a532514631384dbfc9d7fc2002cbbfe52433c9f.tar.gz
gerbonara-7a532514631384dbfc9d7fc2002cbbfe52433c9f.tar.bz2
gerbonara-7a532514631384dbfc9d7fc2002cbbfe52433c9f.zip
Merge pull request #53 from curtacircuitos/pcb_interface
Add PCB interface
Diffstat (limited to 'gerber/tests')
-rw-r--r--gerber/tests/test_layers.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/gerber/tests/test_layers.py b/gerber/tests/test_layers.py
new file mode 100644
index 0000000..c77084d
--- /dev/null
+++ b/gerber/tests/test_layers.py
@@ -0,0 +1,33 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Author: Hamilton Kibbe <ham@hamiltonkib.be>
+
+from .tests import *
+from ..layers import guess_layer_class, hints
+
+
+def test_guess_layer_class():
+ """ Test layer type inferred correctly from filename
+ """
+
+ # Add any specific test cases here (filename, layer_class)
+ test_vectors = [(None, 'unknown'), ('NCDRILL.TXT', 'unknown'),
+ ('example_board.gtl', 'top'),
+ ('exampmle_board.sst', 'topsilk'),
+ ('ipc-d-356.ipc', 'ipc_netlist'),]
+
+ for hint in hints:
+ for ext in hint.ext:
+ assert_equal(hint.layer, guess_layer_class('board.{}'.format(ext)))
+ for name in hint.name:
+ assert_equal(hint.layer, guess_layer_class('{}.pho'.format(name)))
+
+ for filename, layer_class in test_vectors:
+ assert_equal(layer_class, guess_layer_class(filename))
+
+
+def test_sort_layers():
+ """ Test layer ordering
+ """
+ pass