mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
test(gateway): keep Discord document-handling tests hermetic against host DNS
These tests mock the actual download; stub is_safe_url so host DNS/proxy mappings for cdn.discordapp.com can't decide whether document handling is exercised. Residual hunk salvaged from PR #25426 — the rest of that PR's hermeticity fixes (bedrock botocore fakes, faster_whisper module fakes, kittentts plain-sequence PCM, web-provider SSRF stubs) have since landed on main in equivalent form.
This commit is contained in:
parent
63be8ce863
commit
98fea1323b
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue