mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
Cover the unreadable ldgen.cmake branch
This commit is contained in:
@@ -918,6 +918,15 @@ def test_patch_ldgen_cmake_missing_file_is_noop(tmp_path: Path) -> None:
|
||||
_patch_ldgen_cmake(tmp_path) # no tools/cmake/ldgen.cmake present
|
||||
|
||||
|
||||
def test_patch_ldgen_cmake_unreadable_file_warns_and_skips(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
_write_ldgen_cmake(tmp_path, _LDGEN_CMAKE_STOCK)
|
||||
with patch.object(Path, "read_text", side_effect=OSError("boom")):
|
||||
_patch_ldgen_cmake(tmp_path)
|
||||
assert "Could not apply the ldgen dependency patch" in caplog.text
|
||||
|
||||
|
||||
def test_patch_ldgen_cmake_unexpected_depends_skips(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user