Add portable Mentor schematic batch exporter
This commit is contained in:
commit
40fbb1893a
26 files changed
+3622
No files matched your search
@@ -0,0 +1,29 @@
|
||||
def test_inspection_does_not_mix_tools_from_other_installation(tmp_path):
|
||||
from mentorexport.environment import inspect_installation
|
||||
install = tmp_path / "SDD_HOME"
|
||||
(install / "iCDB/win32/bin").mkdir(parents=True)
|
||||
(install / "iCDB/win32/bin/icdb2ascii.exe").write_bytes(b"fixture")
|
||||
result = inspect_installation(install)
|
||||
assert result["tools"]["ascii"] == str(install / "iCDB/win32/bin/icdb2ascii.exe")
|
||||
assert "keyin" not in result["tools"]
|
||||
assert result["native_compatible"] is False
|
||||
|
||||
|
||||
def test_explicit_nonexistent_install_is_rejected(tmp_path):
|
||||
from mentorexport.environment import discover_installations
|
||||
import pytest
|
||||
with pytest.raises(ValueError):
|
||||
discover_installations(explicit=tmp_path / "missing")
|
||||
|
||||
|
||||
def test_preflight_rejects_zero_exit_without_expected_help(tmp_path):
|
||||
from mentorexport.environment import preflight_installation
|
||||
def runner(command, cwd, environment, log_dir, **kwargs):
|
||||
from pathlib import Path
|
||||
Path(log_dir).mkdir(parents=True)
|
||||
(Path(log_dir) / "stdout.txt").write_text("")
|
||||
(Path(log_dir) / "stderr.txt").write_text("")
|
||||
return {"exit_code": 0, "cleanup": {"errors": []}}
|
||||
result = preflight_installation({"root": str(tmp_path), "tools": {"ascii": "ascii.exe"}},
|
||||
tmp_path / "logs", runner=runner)
|
||||
assert result["status"] == "failed"
|
||||
Reference in new issue
Block a user