1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00

Update test for new get_build_info behaviour

get_build_info() now always returns current time instead of preserving
the existing build_time. The timestamp preservation logic is now handled
in copy_src_tree() based on sources_changed flag.
This commit is contained in:
David Woodhouse
2025-12-14 09:07:00 +09:00
parent 4bde4dbdc8
commit 1ebfd5b4eb

View File

@@ -1198,11 +1198,11 @@ def test_get_build_info_new_build(
@patch("esphome.writer.CORE")
def test_get_build_info_config_unchanged_version_unchanged(
def test_get_build_info_always_returns_current_time(
mock_core: MagicMock,
tmp_path: Path,
) -> None:
"""Test get_build_info keeps existing build_time when config and version unchanged."""
"""Test get_build_info always returns current build_time."""
build_info_path = tmp_path / "build_info.json"
mock_core.relative_build_path.return_value = build_info_path
mock_core.config_hash = 0x12345678
@@ -1225,8 +1225,10 @@ def test_get_build_info_config_unchanged_version_unchanged(
config_hash, build_time, build_time_str = get_build_info()
assert config_hash == 0x12345678
assert build_time == existing_build_time
assert build_time_str == existing_build_time_str
# get_build_info now always returns current time
assert build_time != existing_build_time
assert build_time > existing_build_time
assert build_time_str != existing_build_time_str
@patch("esphome.writer.CORE")