Add: Parser + test
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
from pytest import fixture
|
||||
import ergogen_footprint_converter.main as main
|
||||
|
||||
|
||||
@fixture
|
||||
def out_dir (tmp_path):
|
||||
out_dir = tmp_path / "out"
|
||||
out_dir.mkdir()
|
||||
return out_dir
|
||||
|
||||
@fixture
|
||||
def in_name ():
|
||||
return "promicro.kicad_mod"
|
||||
|
||||
@fixture
|
||||
def call_main (in_name, out_dir):
|
||||
args = {
|
||||
"in": "tests/integration/data/simple/" + in_name,
|
||||
"out": out_dir
|
||||
}
|
||||
|
||||
main.main(args)
|
||||
|
||||
return out_dir / (in_name.split('.')[0] + ".js")
|
||||
|
||||
|
||||
def test_exists(call_main):
|
||||
out = call_main
|
||||
|
||||
assert out.exists()
|
||||
|
||||
def test_simple(call_main):
|
||||
out = call_main
|
||||
|
||||
expected = open("tests/integration/data/simple/promicro.js").readlines()
|
||||
|
||||
assert out.read_text() == expected
|
||||
|
||||
Reference in New Issue
Block a user