summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-06-13 15:00:17 +0200
committerjaseg <git@jaseg.de>2021-06-13 15:00:17 +0200
commit4eb0e063bcd34c21b737023aa6ed5baed80658d1 (patch)
tree3a56ef7d05f4f64cde930f2432119986e4aab49d /tests
parent889ea37d9b66cbfb7a61795c7750b9f4311faa3f (diff)
downloadgerbonara-4eb0e063bcd34c21b737023aa6ed5baed80658d1.tar.gz
gerbonara-4eb0e063bcd34c21b737023aa6ed5baed80658d1.tar.bz2
gerbonara-4eb0e063bcd34c21b737023aa6ed5baed80658d1.zip
Repo re-org, make gerberex tests run
Diffstat (limited to 'tests')
-rw-r--r--tests/test_am_expression.py8
-rw-r--r--tests/test_dxf.py36
-rw-r--r--tests/test_excellon.py12
-rw-r--r--tests/test_rs274x.py14
-rw-r--r--tests/test_utility.py2
5 files changed, 36 insertions, 36 deletions
diff --git a/tests/test_am_expression.py b/tests/test_am_expression.py
index 7490284..cf30ab7 100644
--- a/tests/test_am_expression.py
+++ b/tests/test_am_expression.py
@@ -4,10 +4,10 @@
# Copyright 2019 Hiroshi Murayama <opiopan@gmail.com>
import unittest
-from gerberex.am_expression import *
-from gerberex.am_expression import AMOperatorExpression as Op
-from gerber.utils import inch, metric
-from gerber.am_read import read_macro
+from gerbonara.gerber.panelize.am_expression import *
+from gerbonara.gerber.panelize.am_expression import AMOperatorExpression as Op
+from gerbonara.gerber.utils import inch, metric
+from gerbonara.gerber.am_read import read_macro
class TestAMConstantExpression(unittest.TestCase):
def setUp(self):
diff --git a/tests/test_dxf.py b/tests/test_dxf.py
index 782c8c7..e138320 100644
--- a/tests/test_dxf.py
+++ b/tests/test_dxf.py
@@ -5,8 +5,8 @@
import os
import unittest
-import gerberex
-from gerber.utils import inch, metric
+from gerbonara.gerber import panelize
+from gerbonara.gerber.utils import inch, metric
class TestExcellon(unittest.TestCase):
@@ -34,7 +34,7 @@ class TestExcellon(unittest.TestCase):
def test_save_line(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_line.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_LINE
dxf.width = 0.2
dxf.write(outfile)
@@ -42,14 +42,14 @@ class TestExcellon(unittest.TestCase):
def test_save_fill(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_fill.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_FILL
dxf.write(outfile)
self._checkResult(outfile)
def test_save_fill_simple(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_fill_simple.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_FILL
dxf.fill_mode = dxf.FM_SIMPLE
dxf.write(outfile)
@@ -57,7 +57,7 @@ class TestExcellon(unittest.TestCase):
def test_save_mousebites(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save_mousebites.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_MOUSE_BITES
dxf.width = 0.5
dxf.pitch = 1.4
@@ -67,7 +67,7 @@ class TestExcellon(unittest.TestCase):
def test_save_excellon(self):
outfile = os.path.join(
self.OUTDIR, self.OUTPREFIX + 'save_line.txt')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_LINE
dxf.format = (3,3)
dxf.width = 0.2
@@ -77,7 +77,7 @@ class TestExcellon(unittest.TestCase):
def test_save_excellon_mousebites(self):
outfile = os.path.join(
self.OUTDIR, self.OUTPREFIX + 'save_mousebites.txt')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.draw_mode = dxf.DM_MOUSE_BITES
dxf.format = (3, 3)
dxf.width = 0.5
@@ -87,7 +87,7 @@ class TestExcellon(unittest.TestCase):
def test_to_inch(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_inch.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.to_inch()
dxf.format = (2, 5)
dxf.write(outfile)
@@ -95,7 +95,7 @@ class TestExcellon(unittest.TestCase):
def _test_to_metric(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_metric.gtl')
- dxf = gerberex.read(self.INCH_FILE)
+ dxf = panelize.read(self.INCH_FILE)
dxf.to_metric()
dxf.format = (3, 5)
dxf.write(outfile)
@@ -103,34 +103,34 @@ class TestExcellon(unittest.TestCase):
def test_offset(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'offset.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.offset(11, 5)
dxf.write(outfile)
self._checkResult(outfile)
def test_rotate(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'rotate.gtl')
- dxf = gerberex.read(self.METRIC_FILE)
+ dxf = panelize.read(self.METRIC_FILE)
dxf.rotate(20, (10, 10))
dxf.write(outfile)
self._checkResult(outfile)
def test_rectangle_metric(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'rectangle_metric.gtl')
- dxf = gerberex.DxfFile.rectangle(width=10, height=10, units='metric')
+ dxf = panelize.DxfFile.rectangle(width=10, height=10, units='metric')
dxf.write(outfile)
self._checkResult(outfile)
def test_rectangle_inch(self):
outfile = os.path.join(
self.OUTDIR, self.OUTPREFIX + 'rectangle_inch.gtl')
- dxf = gerberex.DxfFile.rectangle(width=inch(10), height=inch(10), units='inch')
+ dxf = panelize.DxfFile.rectangle(width=inch(10), height=inch(10), units='inch')
dxf.write(outfile)
self._checkResult(outfile)
def test_complex_fill(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'complex_fill.gtl')
- dxf = gerberex.read(self.COMPLEX_FILE)
+ dxf = panelize.read(self.COMPLEX_FILE)
dxf.draw_mode = dxf.DM_FILL
dxf.write(outfile)
self._checkResult(outfile)
@@ -138,11 +138,11 @@ class TestExcellon(unittest.TestCase):
def test_complex_fill_flip(self):
outfile = os.path.join(
self.OUTDIR, self.OUTPREFIX + 'complex_fill_flip.gtl')
- ctx = gerberex.GerberComposition()
- base = gerberex.rectangle(width=100, height=100, left=0, bottom=0, units='metric')
+ ctx = panelize.GerberComposition()
+ base = panelize.rectangle(width=100, height=100, left=0, bottom=0, units='metric')
base.draw_mode = base.DM_FILL
ctx.merge(base)
- dxf = gerberex.read(self.COMPLEX_FILE)
+ dxf = panelize.read(self.COMPLEX_FILE)
dxf.negate_polarity()
dxf.draw_mode = dxf.DM_FILL
ctx.merge(dxf)
diff --git a/tests/test_excellon.py b/tests/test_excellon.py
index 36093cd..4aa6dcf 100644
--- a/tests/test_excellon.py
+++ b/tests/test_excellon.py
@@ -5,7 +5,7 @@
import os
import unittest
-import gerberex
+from gerbonara.gerber import panelize
class TestExcellon(unittest.TestCase):
@@ -33,13 +33,13 @@ class TestExcellon(unittest.TestCase):
def test_save(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'save.txt')
- drill = gerberex.read(self.METRIC_FILE)
+ drill = panelize.read(self.METRIC_FILE)
drill.write(outfile)
self._checkResult(outfile)
def test_to_inch(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_inch.txt')
- drill = gerberex.read(self.METRIC_FILE)
+ drill = panelize.read(self.METRIC_FILE)
drill.to_inch()
drill.format = (2, 4)
drill.write(outfile)
@@ -47,7 +47,7 @@ class TestExcellon(unittest.TestCase):
def test_to_metric(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_metric.txt')
- drill = gerberex.read(self.INCH_FILE)
+ drill = panelize.read(self.INCH_FILE)
drill.to_metric()
drill.format = (3, 3)
drill.write(outfile)
@@ -55,14 +55,14 @@ class TestExcellon(unittest.TestCase):
def test_offset(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'offset.txt')
- drill = gerberex.read(self.METRIC_FILE)
+ drill = panelize.read(self.METRIC_FILE)
drill.offset(11, 5)
drill.write(outfile)
self._checkResult(outfile)
def test_rotate(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'rotate.txt')
- drill = gerberex.read(self.METRIC_FILE)
+ drill = panelize.read(self.METRIC_FILE)
drill.rotate(20, (10, 10))
drill.write(outfile)
self._checkResult(outfile)
diff --git a/tests/test_rs274x.py b/tests/test_rs274x.py
index dbb5f62..1a1475a 100644
--- a/tests/test_rs274x.py
+++ b/tests/test_rs274x.py
@@ -5,7 +5,7 @@
import os
import unittest
-import gerberex
+from gerbonara.gerber import panelize
class TestRs274x(unittest.TestCase):
@classmethod
@@ -32,13 +32,13 @@ class TestRs274x(unittest.TestCase):
def test_save(self):
outfile=os.path.join(self.OUTDIR, self.OUTPREFIX + 'save.gtl')
- gerber = gerberex.read(self.METRIC_FILE)
+ gerber = panelize.read(self.METRIC_FILE)
gerber.write(outfile)
self._checkResult(outfile)
def test_to_inch(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_inch.gtl')
- gerber = gerberex.read(self.METRIC_FILE)
+ gerber = panelize.read(self.METRIC_FILE)
gerber.to_inch()
gerber.format = (2,5)
gerber.write(outfile)
@@ -46,7 +46,7 @@ class TestRs274x(unittest.TestCase):
def test_to_metric(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'to_metric.gtl')
- gerber = gerberex.read(self.INCH_FILE)
+ gerber = panelize.read(self.INCH_FILE)
gerber.to_metric()
gerber.format = (3, 4)
gerber.write(outfile)
@@ -54,21 +54,21 @@ class TestRs274x(unittest.TestCase):
def test_offset(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'offset.gtl')
- gerber = gerberex.read(self.METRIC_FILE)
+ gerber = panelize.read(self.METRIC_FILE)
gerber.offset(11, 5)
gerber.write(outfile)
self._checkResult(outfile)
def test_rotate(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'rotate.gtl')
- gerber = gerberex.read(self.METRIC_FILE)
+ gerber = panelize.read(self.METRIC_FILE)
gerber.rotate(20, (10,10))
gerber.write(outfile)
self._checkResult(outfile)
def test_single_quadrant(self):
outfile = os.path.join(self.OUTDIR, self.OUTPREFIX + 'single_quadrant.gtl')
- gerber = gerberex.read(self.SQ_FILE)
+ gerber = panelize.read(self.SQ_FILE)
gerber.write(outfile)
self._checkResult(outfile)
diff --git a/tests/test_utility.py b/tests/test_utility.py
index 4ede8d5..d7a4101 100644
--- a/tests/test_utility.py
+++ b/tests/test_utility.py
@@ -5,7 +5,7 @@
import unittest
-from gerberex.utility import *
+from gerbonara.gerber.panelize.utility import *
from math import sqrt
class TestUtility(unittest.TestCase):