From f91a6979b4a02f15d7ef3e1601f27030208bba36 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 15 Sep 2025 17:37:35 -0500 Subject: [PATCH] add more coverage to make sure we are more careful about deletes --- tests/unit_tests/core/test_config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/core/test_config.py b/tests/unit_tests/core/test_config.py index 4c543bff9c..7d3b90794b 100644 --- a/tests/unit_tests/core/test_config.py +++ b/tests/unit_tests/core/test_config.py @@ -385,7 +385,8 @@ def test_preload_core_config_basic(setup_core: Path) -> None: assert KEY_CORE in CORE.data assert CONF_BUILD_PATH in config[CONF_ESPHOME] # Verify default build path is "build/" - assert config[CONF_ESPHOME][CONF_BUILD_PATH].endswith("build/test_device") + build_path = config[CONF_ESPHOME][CONF_BUILD_PATH] + assert build_path.endswith(os.path.join("build", "test_device")) def test_preload_core_config_with_build_path(setup_core: Path) -> None: @@ -421,7 +422,11 @@ def test_preload_core_config_env_build_path(setup_core: Path) -> None: assert CONF_BUILD_PATH in config[CONF_ESPHOME] assert "test_device" in config[CONF_ESPHOME][CONF_BUILD_PATH] # Verify it uses the env var path with device name appended - assert config[CONF_ESPHOME][CONF_BUILD_PATH].endswith("/env/build/test_device") + build_path = config[CONF_ESPHOME][CONF_BUILD_PATH] + expected_path = os.path.join("/env/build", "test_device") + assert build_path == expected_path or build_path == expected_path.replace( + "/", os.sep + ) assert platform == "rp2040"