From 1d1f2a98770e635307a5df15aca451ebbc272bca Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 29 Dec 2025 16:25:17 -1000 Subject: [PATCH] cover --- tests/unit_tests/test_writer.py | 50 +++++++-------------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/tests/unit_tests/test_writer.py b/tests/unit_tests/test_writer.py index c792f09f79..b103776c36 100644 --- a/tests/unit_tests/test_writer.py +++ b/tests/unit_tests/test_writer.py @@ -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