mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 14:43:51 +00:00
[dashboard] Fix archive handler to properly delete build folders using correct path (#10724)
This commit is contained in:
committed by
Jesse Hills
parent
04f4f79cb4
commit
ddb8fedef7
@@ -368,6 +368,9 @@ def test_preload_core_config_basic(setup_core: Path) -> None:
|
||||
assert platform == "esp32"
|
||||
assert KEY_CORE in CORE.data
|
||||
assert CONF_BUILD_PATH in config[CONF_ESPHOME]
|
||||
# Verify default build path is "build/<device_name>"
|
||||
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:
|
||||
@@ -402,6 +405,12 @@ 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
|
||||
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"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user