mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 08:20:21 +00:00
Trim comments
This commit is contained in:
+1
-2
@@ -341,8 +341,7 @@ def copy_src_tree():
|
||||
existing.get("config_hash") != config_hash
|
||||
or existing.get("esphome_version") != __version__
|
||||
):
|
||||
# Valid JSON that is not an object (truncated or
|
||||
# hand-edited) is stale like every other damage case
|
||||
# Non-object JSON is stale like every other damage case
|
||||
sources_changed = True
|
||||
except (json.JSONDecodeError, OSError):
|
||||
sources_changed = True
|
||||
|
||||
@@ -2072,8 +2072,7 @@ def test_copy_src_tree_detects_config_hash_change(
|
||||
)
|
||||
)
|
||||
|
||||
# Create both existing build_info sources so the staleness decision
|
||||
# reaches the JSON comparison instead of the missing-file branch
|
||||
# Both sources must exist to reach the JSON comparison branch
|
||||
build_info_h_path = esphome_core_path / "build_info_data.h"
|
||||
build_info_h_path.write_text("// old build_info_data.h")
|
||||
(esphome_core_path / "build_info_data.cpp").write_text("// old")
|
||||
@@ -2138,8 +2137,7 @@ def test_copy_src_tree_detects_version_change(
|
||||
)
|
||||
)
|
||||
|
||||
# Create both existing build_info sources so the staleness decision
|
||||
# reaches the JSON comparison instead of the missing-file branch
|
||||
# Both sources must exist to reach the JSON comparison branch
|
||||
build_info_h_path = esphome_core_path / "build_info_data.h"
|
||||
build_info_h_path.write_text("// old build_info_data.h")
|
||||
(esphome_core_path / "build_info_data.cpp").write_text("// old")
|
||||
@@ -2190,8 +2188,7 @@ def test_copy_src_tree_handles_invalid_build_info_json(
|
||||
build_info_json_path = build_path / "build_info.json"
|
||||
build_info_json_path.write_text("invalid json {{{")
|
||||
|
||||
# Create both existing build_info sources so the staleness decision
|
||||
# reaches the JSON comparison instead of the missing-file branch
|
||||
# Both sources must exist to reach the JSON comparison branch
|
||||
build_info_h_path = esphome_core_path / "build_info_data.h"
|
||||
build_info_h_path.write_text("// old build_info_data.h")
|
||||
(esphome_core_path / "build_info_data.cpp").write_text("// old")
|
||||
@@ -2238,12 +2235,10 @@ def test_copy_src_tree_handles_non_dict_build_info_json(
|
||||
build_path = tmp_path / "build"
|
||||
build_path.mkdir()
|
||||
|
||||
# Valid JSON that is not an object: no .get, must read as stale
|
||||
build_info_json_path = build_path / "build_info.json"
|
||||
build_info_json_path.write_text("[]")
|
||||
|
||||
# Create both existing build_info sources so the staleness decision
|
||||
# reaches the JSON comparison instead of the missing-file branch
|
||||
# Both sources must exist to reach the JSON comparison branch
|
||||
build_info_h_path = esphome_core_path / "build_info_data.h"
|
||||
build_info_h_path.write_text("// old build_info_data.h")
|
||||
(esphome_core_path / "build_info_data.cpp").write_text("// old")
|
||||
|
||||
Reference in New Issue
Block a user