From 3fb26e6940b5ae752308d8a33f2608d266795153 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 29 Dec 2021 19:58:20 +0100 Subject: Basic round-trip works --- gerbonara/gerber/tests/panelize/test_rs274x.py | 70 -------------------------- 1 file changed, 70 deletions(-) delete mode 100644 gerbonara/gerber/tests/panelize/test_rs274x.py (limited to 'gerbonara/gerber/tests/panelize') diff --git a/gerbonara/gerber/tests/panelize/test_rs274x.py b/gerbonara/gerber/tests/panelize/test_rs274x.py deleted file mode 100644 index 73f3172..0000000 --- a/gerbonara/gerber/tests/panelize/test_rs274x.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright 2019 Hiroshi Murayama - -import os -import tempfile -from pathlib import Path -from contextlib import contextmanager -import unittest -from ...rs274x import read - -class TestRs274x(unittest.TestCase): - @classmethod - def setUpClass(cls): - here = Path(__file__).parent - cls.EXPECTSDIR = here / 'expects' - cls.METRIC_FILE = here / 'data' / 'ref_gerber_metric.gtl' - cls.INCH_FILE = here / 'data' / 'ref_gerber_inch.gtl' - cls.SQ_FILE = here / 'data' / 'ref_gerber_single_quadrant.gtl' - - @contextmanager - def _check_result(self, reference_fn): - with tempfile.NamedTemporaryFile('rb') as tmp_out: - yield tmp_out.name - - actual = tmp_out.read() - expected = (self.EXPECTSDIR / reference_fn).read_bytes() - - print('==== ACTUAL ===') - print(actual.decode()) - print() - print() - print('==== EXPECTED ===') - print(expected.decode()) - print() - print() - self.assertEqual(actual, expected) - - def test_save(self): - with self._check_result('RS2724x_save.gtl') as outfile: - gerber = read(self.METRIC_FILE) - gerber.write(outfile) - - def test_to_inch(self): - with self._check_result('RS2724x_to_inch.gtl') as outfile: - gerber = read(self.METRIC_FILE) - gerber.to_inch() - gerber.format = (2,5) - gerber.write(outfile) - - def test_to_metric(self): - with self._check_result('RS2724x_to_metric.gtl') as outfile: - gerber = read(self.INCH_FILE) - gerber.to_metric() - gerber.format = (3, 4) - gerber.write(outfile) - - def test_offset(self): - with self._check_result('RS2724x_offset.gtl') as outfile: - gerber = read(self.METRIC_FILE) - gerber.offset(11, 5) - gerber.write(outfile) - - def test_rotate(self): - with self._check_result('RS2724x_rotate.gtl') as outfile: - gerber = read(self.METRIC_FILE) - gerber.rotate(20, (10,10)) - gerber.write(outfile) - -- cgit