aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-08-18 21:39:54 +0200
committerjaseg <git@jaseg.de>2021-08-18 21:39:54 +0200
commit956538a32c00048a598016e6771a67db332be699 (patch)
tree2ac9c2fe4c2dceed942d93f4dc164d8262cce92a /svg-flatten
parentfae8532b05b8c3cd79cd09a6b1986bc8ff9ad306 (diff)
downloadgerbolyze-956538a32c00048a598016e6771a67db332be699.tar.gz
gerbolyze-956538a32c00048a598016e6771a67db332be699.tar.bz2
gerbolyze-956538a32c00048a598016e6771a67db332be699.zip
svg-flatten: Add multi-exclude/include tests
Diffstat (limited to 'svg-flatten')
-rw-r--r--svg-flatten/src/test/svg_tests.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/svg-flatten/src/test/svg_tests.py b/svg-flatten/src/test/svg_tests.py
index 4db827e..3784c59 100644
--- a/svg-flatten/src/test/svg_tests.py
+++ b/svg-flatten/src/test/svg_tests.py
@@ -5,6 +5,7 @@ import shutil
import unittest
from pathlib import Path
import subprocess
+import itertools
import os
from PIL import Image
@@ -168,20 +169,20 @@ class SVGRoundTripTests(unittest.TestCase):
vectorizer_test = test_in_svg.stem.startswith('vectorizer')
contours_test = test_in_svg.stem.startswith('contours')
- if not vectorizer_test:
- run_svg_flatten(test_in_svg, tmp_out_svg.name, format='svg')
+
+ if vectorizer_test:
+ run_svg_flatten(test_in_svg, tmp_out_svg.name, format='svg',
+ svg_white_is_gerber_dark=True,
+ clear_color='black', dark_color='white')
elif contours_test:
- run_svg_flatten(test_in_svg, tmp_out_svg.name,
+ run_svg_flatten(test_in_svg, tmp_out_svg.name, format='svg',
clear_color='black', dark_color='white',
svg_white_is_gerber_dark=True,
- format='svg',
vectorizer='binary-contours')
else:
- run_svg_flatten(test_in_svg, tmp_out_svg.name, format='svg',
- svg_white_is_gerber_dark=True,
- clear_color='black', dark_color='white')
+ run_svg_flatten(test_in_svg, tmp_out_svg.name, format='svg')
if not use_rsvg: # default!
run_cargo_cmd('resvg', [tmp_out_svg.name, tmp_out_png.name], check=True, stdout=subprocess.DEVNULL)
@@ -216,5 +217,10 @@ for group in ["g0", "g00", "g000", "g0000", "g00000", "g0001", "g001", "g0010",
setattr(SVGRoundTripTests, f'test_group_sel_inc_{group}', gen('inc', [group]))
setattr(SVGRoundTripTests, f'test_group_sel_exc_{group}', gen('exc', [group]))
+for g0, g1 in itertools.product(["g0", "g0000", "g0001", "g0010", "g002","path846-59"], repeat=2):
+ gen = lambda mode, group: lambda self: self.run_svg_group_selector_test(mode, group)
+ setattr(SVGRoundTripTests, f'test_group_sel_inc_{g0}_{g1}', gen('inc', [g0, g1]))
+ setattr(SVGRoundTripTests, f'test_group_sel_exc_{g0}_{g1}', gen('exc', [g0, g1]))
+
if __name__ == '__main__':
unittest.main()