From efe5d835eaa26d8696c3352c4e1ed42da16fe27b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 7 Dec 2017 23:48:02 +0100 Subject: wip --- test/kicad_pcb/parser-1.kicad_pcb | 2 +- test/test_parse_kicad_pcb.py | 12 ------------ test/test_parse_pcb.py | 15 +++++++++++++++ test/test_parse_sexpr.py | 12 ++++++++++++ 4 files changed, 28 insertions(+), 13 deletions(-) delete mode 100644 test/test_parse_kicad_pcb.py create mode 100644 test/test_parse_pcb.py create mode 100644 test/test_parse_sexpr.py (limited to 'test') 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_kicad_pcb.py b/test/test_parse_kicad_pcb.py deleted file mode 100644 index 25c1957..0000000 --- a/test/test_parse_kicad_pcb.py +++ /dev/null @@ -1,12 +0,0 @@ -import pytest -import os.path -from ee.kicad import parse_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 - for (event, token) in parse_kicad_pcb(path): - count = count + 1 - assert count == 3657 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_sexpr.py b/test/test_parse_sexpr.py new file mode 100644 index 0000000..4a97507 --- /dev/null +++ b/test/test_parse_sexpr.py @@ -0,0 +1,12 @@ +import pytest +import os.path +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 sexpr.parse(path): + count = count + 1 + assert count == 3657 -- cgit v1.2.3