async def METHOD_NAME(self, bot: MockedBot):
    bot.session.api = TelegramAPIServer.from_base("http://localhost:8081", is_local=True)
    fd, tmp = mkstemp(prefix="test-", suffix=".txt")
    value = b"KABOOM"
    try:
        with open(fd, "wb") as f:
            f.write(value)
        content = await bot.download_file(tmp)
        assert content.getvalue() == value
    finally:
        os.unlink(tmp)