summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/tests/test_rs274x.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-24 14:19:01 +0100
committerjaseg <git@jaseg.de>2022-01-24 14:19:01 +0100
commita1c1d6d971257f03f1926db9dc44e659d2773d2d (patch)
tree443af73413f52b47fbbddf185bb497fb483c93c0 /gerbonara/gerber/tests/test_rs274x.py
parent4a6d76c557caf7263ab57e5fe840d28aa3356621 (diff)
downloadgerbonara-a1c1d6d971257f03f1926db9dc44e659d2773d2d.tar.gz
gerbonara-a1c1d6d971257f03f1926db9dc44e659d2773d2d.tar.bz2
gerbonara-a1c1d6d971257f03f1926db9dc44e659d2773d2d.zip
Add more tests
Diffstat (limited to 'gerbonara/gerber/tests/test_rs274x.py')
-rw-r--r--gerbonara/gerber/tests/test_rs274x.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gerbonara/gerber/tests/test_rs274x.py b/gerbonara/gerber/tests/test_rs274x.py
index 83148a5..fdd9a81 100644
--- a/gerbonara/gerber/tests/test_rs274x.py
+++ b/gerbonara/gerber/tests/test_rs274x.py
@@ -275,6 +275,17 @@ def test_round_trip(reference, tmpfile):
assert hist[9] == 0
assert hist[3:].sum() < 5e-5*hist.size
+@filter_syntax_warnings
+@pytest.mark.parametrize('reference', REFERENCE_FILES, indirect=True)
+def test_idempotence(reference, tmpfile):
+ tmp_gbr_1 = tmpfile('First generation output', '.gbr')
+ tmp_gbr_2 = tmpfile('Second generation output', '.gbr')
+
+ GerberFile.open(reference).save(tmp_gbr_1)
+ GerberFile.open(tmp_gbr_1).save(tmp_gbr_2)
+ assert tmp_gbr_1.read_text() == tmp_gbr_2.read_text()
+
+
TEST_ANGLES = [90, 180, 270, 30, 1.5, 10, 360, 1024, -30, -90]
TEST_OFFSETS = [(0, 0), (100, 0), (0, 100), (2, 0), (10, 100)]