From 2c7a2f849d26a3f4dc55a8015d0d2f8cb413b5d5 Mon Sep 17 00:00:00 2001 From: Matysh Date: Tue, 28 Jul 2026 20:38:49 +0300 Subject: [PATCH] test: files/cleanup reports counts now, not a boolean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It answers {removed, kept} since v1.46.5 — the 'kept' side is the point: files the stored configuration still references survive a cleanup of their folder. --- tests_backend/test_ha_websocket.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests_backend/test_ha_websocket.py b/tests_backend/test_ha_websocket.py index 1391e1b..d364f18 100644 --- a/tests_backend/test_ha_websocket.py +++ b/tests_backend/test_ha_websocket.py @@ -176,10 +176,12 @@ async def test_files_migrate_copies_and_reports_mapping( assert src_kept, "migrate must COPY, not move (review CR-2)" assert other == b"OTHER" and copied == b"SOURCE" - # cleanup runs only after the config is safely committed + # cleanup runs only after the config is safely committed, and since v1.46.5 + # reports how many files it removed rather than a bare boolean — it now also + # keeps anything the stored configuration still references await client.send_json_auto_id({"type": "houseplan/files/cleanup", "marker_id": "old1"}) resp2 = await client.receive_json() - assert resp2["success"] and resp2["result"]["removed"] is True + assert resp2["success"] and resp2["result"]["removed"] >= 1 and resp2["result"]["kept"] == 0 assert not await hass.async_add_executor_job(lambda: os.path.isdir(src))