MCPcopy Create free account
hub / github.com/AstrBotDevs/AstrBot / fake_download

Function fake_download

tests/test_openai_source.py:840–843  ·  view source on GitHub ↗
(url: str, target_path: str)

Source from the content-addressed store, hash-verified

838 PILImage.new("RGBA", (1, 1), (255, 0, 0, 255)).save(image_path)
839
840 async def fake_download(url: str, target_path: str) -> None:
841 assert url == "https://example.com/quoted.png"
842 with open(target_path, "wb") as f:
843 f.write(image_path.read_bytes())
844
845 monkeypatch.setattr(
846 "astrbot.core.utils.media_utils.download_file",

Callers

nothing calls this directly

Calls 2

read_bytesMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected