diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/kicad_pcb/parser-1.kicad_pcb | 2 | ||||
-rw-r--r-- | test/test_parse_pcb.py | 15 | ||||
-rw-r--r-- | test/test_parse_sexpr.py (renamed from test/test_parse_kicad_pcb.py) | 4 |
3 files changed, 18 insertions, 3 deletions
diff --git a/test/kicad_pcb/parser-1.kicad_pcb b/test/kicad_pcb/parser-1.kicad_pcb index b8efabc..9aa6ab4 100644 --- a/test/kicad_pcb/parser-1.kicad_pcb +++ b/test/kicad_pcb/parser-1.kicad_pcb @@ -2,7 +2,7 @@ (general (links 5) - (no_connects 0) + (no_connects 1) (area 139.649999 101.549999 152.450001 109.270001) (thickness 1.6) (drawings 5) diff --git a/test/test_parse_pcb.py b/test/test_parse_pcb.py new file mode 100644 index 0000000..9592b92 --- /dev/null +++ b/test/test_parse_pcb.py @@ -0,0 +1,15 @@ +import pytest +import os.path +import ee.kicad.pcb + +basedir = os.path.dirname(os.path.abspath(__file__)) + +def test_parsing(): + path = os.path.join(basedir, "kicad_pcb/parser-1.kicad_pcb") + count = 0 + kicad_pcb = ee.kicad.pcb.parse(path) + modules = kicad_pcb.modules + del kicad_pcb.modules + print(str(kicad_pcb)) + for m in modules: + print(m) diff --git a/test/test_parse_kicad_pcb.py b/test/test_parse_sexpr.py index 25c1957..4a97507 100644 --- a/test/test_parse_kicad_pcb.py +++ b/test/test_parse_sexpr.py @@ -1,12 +1,12 @@ import pytest import os.path -from ee.kicad import parse_kicad_pcb +import ee.kicad.sexpr as sexpr basedir = os.path.dirname(os.path.abspath(__file__)) def test_parsing(): path = os.path.join(basedir, "kicad_pcb/parser-1.kicad_pcb") count = 0 - for (event, token) in parse_kicad_pcb(path): + for (event, token) in sexpr.parse(path): count = count + 1 assert count == 3657 |