Skip to content

The agent that grows with you

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

teknium1b602ba296e81
diff --git a/tests/gateway/test_whatsapp_group_gating.py b/tests/gateway/test_whatsapp_group_gating.py
index 2e9b152dd1e..96c5fd8c10c 100644
--- a/tests/gateway/test_whatsapp_group_gating.py
+++ b/tests/gateway/test_whatsapp_group_gating.py
@@ -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() == {"[email protected]"}
+ # 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()