Cover the testing-mode flash-ld OSError guard

This commit is contained in:
J. Nick Koston
2026-08-21 13:06:33 -05:00
parent 211889cfb6
commit 84de74663c
@@ -346,6 +346,20 @@ def test_generate_ld_scripts_testing_mode(tmp_path: Path) -> None:
assert "len = 0x2000000" in patched
def test_generate_ld_scripts_testing_mode_missing_flash_ld_raises(
tmp_path: Path,
) -> None:
"""A missing flash ld in testing mode names the file and the fix."""
paths = _make_framework(tmp_path)
CORE.testing_mode = True
result = MagicMock(returncode=0, stdout=_COMMON_LD_H_OUTPUT, stderr="")
with (
patch.object(arduino8266.subprocess, "run", return_value=result),
pytest.raises(EsphomeError, match="Could not read .*clean-all"),
):
_run_generate_ld_scripts(paths)
def test_build_config_nonosdk_precedence() -> None:
"""With two SDK knobs set (a pathological config), ties break
deterministically by table order."""