test(whatsapp): an explicit empty free_response_chats list is asserted without an explicit env value

Under env → YAML → default an explicit env CSV beats the YAML list; the test now
blanks the env (blank env = unset) before asserting that [] is a real 'no chats'
value.
This commit is contained in:
teknium1
2026-09-13 15:30:07 -07:00
committed by Teknium
parent 178bf0436c
commit b602ba296e
@@ -126,6 +126,8 @@ def test_blank_free_response_chats_falls_through_to_env(monkeypatch):
adapter = object.__new__(WhatsAppAdapter)
adapter.config = PlatformConfig(enabled=True, extra={"free_response_chats": ""})
assert adapter._whatsapp_free_response_chats() == {"123@g.us"}
# An explicit empty list is a real "no chats" value once no explicit env is set.
monkeypatch.setenv("WHATSAPP_FREE_RESPONSE_CHATS", " ")
adapter.config = PlatformConfig(enabled=True, extra={"free_response_chats": []})
assert adapter._whatsapp_free_response_chats() == set()