test(cron): delivery-targets test scopes platform assertions past bot-chat entries

cron_delivery_targets() now also lists machine-local bot-chat:<profile>
entries; the sibling test's exact set-equality assertion predates them.
Scope the platform assertions to gateway entries and pin that bot-chat
entries are always home_target_set.
This commit is contained in:
Teknium
2026-08-21 04:52:18 -07:00
parent a2da0ab797
commit b96a9b7408
+13 -4
View File
@@ -2194,11 +2194,20 @@ class TestCronDeliveryTargets:
targets = {t["id"]: t for t in cron_delivery_targets()}
assert set(targets) == {"matrix", "telegram"}
# bot-chat:<profile> entries (machine-local Bot Chat injection) ride
# the same listing but are not gateway platforms — scope the
# platform assertions to the gateway entries.
platform_targets = {k: v for k, v in targets.items() if not k.startswith("bot-chat")}
assert set(platform_targets) == {"matrix", "telegram"}
# Configured but no home channel → surfaced, flagged for the UI.
assert targets["matrix"]["home_target_set"] is False
assert targets["matrix"]["home_env_var"] == "MATRIX_HOME_ROOM"
assert targets["telegram"]["home_target_set"] is False
assert platform_targets["matrix"]["home_target_set"] is False
assert platform_targets["matrix"]["home_env_var"] == "MATRIX_HOME_ROOM"
assert platform_targets["telegram"]["home_target_set"] is False
# Bot Chat targets need no home channel: whatever profiles exist on
# this machine must all be listed as ready.
bot_chat = [v for k, v in targets.items() if k.startswith("bot-chat")]
assert all(t["home_target_set"] for t in bot_chat)
class TestHomeTargetEnvVarRegistry: