The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(discord): trim allowlist salvage tests to the two headline invariants
kshitijk4poor72faaf8ad818
diff --git a/tests/gateway/test_discord_connect.py b/tests/gateway/test_discord_connect.pyindex 21ce7d315a6..2d7bc142d81 100644--- a/tests/gateway/test_discord_connect.py+++ b/tests/gateway/test_discord_connect.py@@ -191,20 +191,6 @@ async def test_resolve_allowed_usernames_ignores_display_names(monkeypatch, capsassert "display name" not in capsys.readouterr().out-async def test_resolve_allowed_usernames_flags_display_name_entries(monkeypatch, capsys):- adapter = DiscordAdapter(PlatformConfig(enabled=True, token="test-token"))- adapter._allowed_user_ids = {"Bob"}- member = _member(333, "robert", global_name="Bob")- adapter._client = SimpleNamespace(guilds=[SimpleNamespace(name="g", members=[member], member_count=1)])- monkeypatch.setenv("DISCORD_ALLOWED_USERS", "Bob")-- await adapter._resolve_allowed_usernames()-- assert adapter._allowed_user_ids == set()- assert "'bob' matches only a display name or server nickname" in capsys.readouterr().out--@pytest.mark.asyncioasync def test_reconnect_closes_previous_client_to_prevent_zombie_websocket(monkeypatch):"""Regression for #18187: calling connect() twice without disconnect() indiff --git a/tests/gateway/test_discord_username_allowlist_env_reload.py b/tests/gateway/test_discord_username_allowlist_env_reload.pyindex 5d861d9d906..e1f5d82e84f 100644--- a/tests/gateway/test_discord_username_allowlist_env_reload.py+++ b/tests/gateway/test_discord_username_allowlist_env_reload.py@@ -197,11 +197,3 @@ class TestRemovedNumericEntryIsNotResurrected:assert runner._is_user_authorized(_discord_source(PAIRED_ID)) is False# The username-resolved operator is still carried across the reload.assert runner._is_user_authorized(_discord_source()) is True-- def test_numeric_only_allowlist_snapshot_grants_nothing(self, monkeypatch):- adapter = _resolved_discord_adapter({OPERATOR_ID, PAIRED_ID}, [])- assert adapter.resolved_allowlist_user_ids() == set()- monkeypatch.setenv("DISCORD_ALLOWED_USERS", OPERATOR_ID)- runner = _make_runner(adapter)- assert runner._is_user_authorized(_discord_source(PAIRED_ID)) is False- assert runner._is_user_authorized(_discord_source()) is True