mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Add stream_content to BaseSession and add tests
This commit is contained in:
parent
213f2a3c16
commit
7ab0db7991
3 changed files with 33 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from collections import deque
|
||||
from typing import TYPE_CHECKING, Deque, Optional, Type
|
||||
from typing import TYPE_CHECKING, AsyncGenerator, Deque, Optional, Type
|
||||
|
||||
from aiogram import Bot
|
||||
from aiogram.api.client.session.base import BaseSession
|
||||
|
|
@ -29,6 +29,11 @@ class MockedSession(BaseSession):
|
|||
self.raise_for_status(response)
|
||||
return response.result # type: ignore
|
||||
|
||||
async def stream_content(
|
||||
self, url: str, timeout: int, chunk_size: int
|
||||
) -> AsyncGenerator[bytes, None]: # pragma: no cover
|
||||
yield b""
|
||||
|
||||
|
||||
class MockedBot(Bot):
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue