summaryrefslogtreecommitdiff
path: root/gerber/tests/test_layers.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/tests/test_layers.py')
-rw-r--r--gerber/tests/test_layers.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/gerber/tests/test_layers.py b/gerber/tests/test_layers.py
index 6cafecf..597c0d3 100644
--- a/gerber/tests/test_layers.py
+++ b/gerber/tests/test_layers.py
@@ -61,7 +61,8 @@ def test_guess_layer_class_regex():
Hint(layer='top',
ext=[],
name=[],
- regex=r'(.*)(\scopper top|\stop copper)$'
+ regex=r'(.*)(\scopper top|\stop copper)$',
+ content=[]
),
]
hints.extend(layer_hints)
@@ -70,6 +71,27 @@ def test_guess_layer_class_regex():
assert_equal(layer_class, guess_layer_class(filename))
+def test_guess_layer_class_by_content():
+ """ Test layer class by checking content
+ """
+
+ expected_layer_class = 'bottom'
+ filename = os.path.join(os.path.dirname(__file__),
+ 'resources/example_guess_by_content.g0')
+
+ layer_hints = [
+ Hint(layer='bottom',
+ ext=[],
+ name=[],
+ regex='',
+ content=['G04 Layer name: Bottom']
+ )
+ ]
+ hints.extend(layer_hints)
+
+ assert_equal(expected_layer_class, guess_layer_class_by_content(filename))
+
+
def test_sort_layers():
""" Test layer ordering
"""