feat: add safe native Mentor PDF exporter and tested portable UI

This commit is contained in:
Codex committed 2026-10-09 21:32:31 +08:00
1 parent 10a87d2cee
commit d4928af5b6
33 files changed
+2267 -13

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
from mentor_pdf_export.scanner import scan_projects
def test_scans_children_even_when_root_contains_project(project_factory, tmp_path):
root = project_factory(".", "top")
child = project_factory("nested", "child")
assert {p.path for p in scan_projects(tmp_path)} == {root.resolve(), child.resolve()}
def test_prunes_pcb_backups_and_output(project_factory, tmp_path):
good = project_factory("good")
project_factory("good/PCB", "fake")
project_factory("ProjectBackup/old", "old")
project_factory("output", "export_copy")
project_factory("layout", "layout", schematic=False)
assert [p.path for p in scan_projects(tmp_path)] == [good.resolve()]
def test_explicit_excluded_root(project_factory, tmp_path):
good = project_factory("good")
project_factory("other")
assert [p.path for p in scan_projects(tmp_path, excluded_roots=(tmp_path / "other",))] == [good.resolve()]
def test_reads_actual_root_block(project_factory, tmp_path):
project_factory()
assert scan_projects(tmp_path)[0].root_blocks == ("ROOT",)