1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00
This commit is contained in:
J. Nick Koston
2025-12-29 16:25:17 -10:00
parent 1472914527
commit 1d1f2a9877

View File

@@ -175,36 +175,21 @@ def test_storage_edge_case_from_empty_integrations(
# Tests for storage_should_update_cmake_cache
@pytest.mark.parametrize("framework", ["arduino", "esp-idf"])
def test_storage_should_update_cmake_cache_when_integration_added_esp32(
create_storage: Callable[..., StorageJSON],
framework: str,
) -> None:
"""Test cmake cache update triggered when integration added on ESP32."""
old = create_storage(
loaded_integrations=["api", "wifi"],
core_platform="esp32",
framework="arduino",
framework=framework,
)
new = create_storage(
loaded_integrations=["api", "wifi", "restart"],
core_platform="esp32",
framework="arduino",
)
assert storage_should_update_cmake_cache(old, new) is True
def test_storage_should_update_cmake_cache_when_integration_added_esp32_idf(
create_storage: Callable[..., StorageJSON],
) -> None:
"""Test cmake cache update triggered when integration added on ESP32-IDF."""
old = create_storage(
loaded_integrations=["api", "wifi"],
core_platform="esp32",
framework="esp-idf",
)
new = create_storage(
loaded_integrations=["api", "wifi", "restart"],
core_platform="esp32",
framework="esp-idf",
framework=framework,
)
assert storage_should_update_cmake_cache(old, new) is True
@@ -245,35 +230,20 @@ def test_storage_should_not_update_cmake_cache_when_nothing_changes(
assert storage_should_update_cmake_cache(old, new) is False
def test_storage_should_not_update_cmake_cache_for_esp8266(
@pytest.mark.parametrize("core_platform", ["esp8266", "rp2040", "bk72xx", "rtl87xx"])
def test_storage_should_not_update_cmake_cache_for_non_esp32(
create_storage: Callable[..., StorageJSON],
core_platform: str,
) -> None:
"""Test cmake cache not updated for ESP8266 (uses different build system)."""
"""Test cmake cache not updated for non-ESP32 platforms."""
old = create_storage(
loaded_integrations=["api", "wifi"],
core_platform="esp8266",
core_platform=core_platform,
framework="arduino",
)
new = create_storage(
loaded_integrations=["api", "wifi", "restart"],
core_platform="esp8266",
framework="arduino",
)
assert storage_should_update_cmake_cache(old, new) is False
def test_storage_should_not_update_cmake_cache_for_rp2040(
create_storage: Callable[..., StorageJSON],
) -> None:
"""Test cmake cache not updated for RP2040."""
old = create_storage(
loaded_integrations=["api", "wifi"],
core_platform="rp2040",
framework="arduino",
)
new = create_storage(
loaded_integrations=["api", "wifi", "restart"],
core_platform="rp2040",
core_platform=core_platform,
framework="arduino",
)
assert storage_should_update_cmake_cache(old, new) is False