mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
[3.x] Check status code when downloading file (#1079)
* Check status code when downloading file and raise an error if someting bad happends * Style fixes * Add doc * Use "towncrier create <issue>.<type>" for creating file
This commit is contained in:
parent
94e11ce8e9
commit
184ee1fbf8
7 changed files with 45 additions and 7 deletions
|
|
@ -37,7 +37,11 @@ class MockedSession(BaseSession):
|
|||
return response.result # type: ignore
|
||||
|
||||
async def stream_content(
|
||||
self, url: str, timeout: int, chunk_size: int
|
||||
self,
|
||||
url: str,
|
||||
timeout: int,
|
||||
chunk_size: int,
|
||||
raise_for_status: bool,
|
||||
) -> AsyncGenerator[bytes, None]: # pragma: no cover
|
||||
yield b""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue