35 lines
690 B
Python
35 lines
690 B
Python
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 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("promicro.kicad_mod")
|
|
|
|
assert out.exists()
|
|
|
|
def test_simple(call_main):
|
|
out = call_main("promicro.kicad_mod")
|
|
|
|
expected = open("tests/integration/data/simple/promicro.js").readlines()
|
|
|
|
assert out.read_text() == expected
|
|
|