aboutsummaryrefslogtreecommitdiff
path: root/gerbolyze/tests/test_integration.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-30 14:54:46 +0200
committerjaseg <git@jaseg.de>2023-03-30 14:54:46 +0200
commitbc63166a40f522014dfd11e830cce11d6d61be6d (patch)
tree68cfdb9fc743a07b1d5f3ac7bd5909208b355e0e /gerbolyze/tests/test_integration.py
parent2df63318a272fcf2d1f1f6652c999cc3c415d431 (diff)
downloadgerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.tar.gz
gerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.tar.bz2
gerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.zip
svg-flatten: Make drill size mapping more precise, add tests
Diffstat (limited to 'gerbolyze/tests/test_integration.py')
-rw-r--r--gerbolyze/tests/test_integration.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/gerbolyze/tests/test_integration.py b/gerbolyze/tests/test_integration.py
index 668e745..7456e85 100644
--- a/gerbolyze/tests/test_integration.py
+++ b/gerbolyze/tests/test_integration.py
@@ -20,6 +20,7 @@ import subprocess
import tempfile
from pathlib import Path
+import gerbonara
import pytest
@@ -67,7 +68,20 @@ def test_convert_layers():
infile = reference_path('layers.svg')
with tempfile.TemporaryDirectory() as out_dir:
run_command('python3', '-m', 'gerbolyze', 'convert', infile, out_dir)
- out_dir = Path(out_dir)
- print(list(out_dir.glob('*')))
- assert False
+ stack = gerbonara.layers.LayerStack.open(out_dir)
+ for layer, dia in {
+ 'top paste': 0.100,
+ 'top silk': 0.110,
+ 'top mask': 0.120,
+ 'top copper': 0.130,
+ 'bottom copper': 0.140,
+ 'bottom mask': 0.150,
+ 'bottom silk': 0.160,
+ 'bottom paste': 0.170,
+ 'mechanical outline': 0.09}.items():
+ assert set(round(ap.diameter, 4) for ap in stack[layer].apertures) == {dia, 0.05}
+
+ # Note: svg-flatten rounds these diameters to the geometric tolerance given on the command line (0.01mm by
+ # default). Thus, these values are different from the more precise values in the SVG.
+ assert set(stack.drill_layers[0].drill_sizes()) == {0.67, 0.51}