From 1ebfd5b4ebe967c75b3db03d1072eba53ed9024d Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 14 Dec 2025 09:07:00 +0900 Subject: [PATCH] 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. --- tests/unit_tests/test_writer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/test_writer.py b/tests/unit_tests/test_writer.py index cd29efc850..d74919dc3e 100644 --- a/tests/unit_tests/test_writer.py +++ b/tests/unit_tests/test_writer.py @@ -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")