mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
Call the file unreadable, not damaged, and tolerate a concurrent removal
EACCES/EISDIR land in the same arm, so the warning no longer claims corruption; missing_ok on the unlink keeps a concurrent clean from logging a spurious failure for a file already in the desired state.
This commit is contained in:
@@ -2161,7 +2161,7 @@ def test_copy_src_tree_missing_build_info_rebuilds_quietly(
|
||||
build_info_json_path.unlink()
|
||||
_run_copy_src_tree()
|
||||
assert json.loads(build_info_json_path.read_text())["config_hash"] == 0xDEADBEEF
|
||||
assert "damaged" not in caplog.text
|
||||
assert "unreadable" not in caplog.text
|
||||
|
||||
|
||||
@patch("esphome.writer.CORE")
|
||||
@@ -2189,7 +2189,7 @@ def test_copy_src_tree_unremovable_damaged_build_info_is_logged(
|
||||
|
||||
with patch.object(Path, "unlink", fail_on_build_info):
|
||||
_run_copy_src_tree()
|
||||
assert "Could not remove damaged build_info.json" in caplog.text
|
||||
assert "Could not remove unreadable build_info.json" in caplog.text
|
||||
assert json.loads(build_info_json_path.read_text())["config_hash"] == 0xDEADBEEF
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user