Skip to content

The agent that grows with you

test(gateway): keep Discord document-handling tests hermetic against host DNS

Zavian98fea1323b33
diff --git a/tests/gateway/test_discord_document_handling.py b/tests/gateway/test_discord_document_handling.py
index c9f8f53c283..39b69dedca2 100644
--- a/tests/gateway/test_discord_document_handling.py
+++ b/tests/gateway/test_discord_document_handling.py
@@ -97,6 +97,9 @@ def _redirect_cache(tmp_path, monkeypatch):
def adapter(monkeypatch):
monkeypatch.setattr(discord_platform.discord, "DMChannel", FakeDMChannel, raising=False)
monkeypatch.setattr(discord_platform.discord, "Thread", FakeThread, raising=False)
+ # These tests mock the actual download. Do not let host DNS/proxy mappings
+ # for cdn.discordapp.com decide whether document handling is exercised.
+ monkeypatch.setattr(discord_platform, "is_safe_url", lambda _url: True)
config = PlatformConfig(enabled=True, token="fake-token")
a = DiscordAdapter(config)