mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 07:22:15 -04:00
Typecheck tests.rest.media.v1.test_media_storage (#15008)
* Fix MediaStorage type hint * Typecheck tests.rest.media.v1.test_media_storage * Changelog * Remove assert and make the comment succinct * Fix syntax for olddeps
This commit is contained in:
parent
4dd2b6165c
commit
2dff93099b
4 changed files with 35 additions and 23 deletions
|
@ -46,10 +46,9 @@ from ._base import FileInfo, Responder
|
|||
from .filepath import MediaFilePaths
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.rest.media.v1.storage_provider import StorageProvider
|
||||
from synapse.server import HomeServer
|
||||
|
||||
from .storage_provider import StorageProviderWrapper
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -68,7 +67,7 @@ class MediaStorage:
|
|||
hs: "HomeServer",
|
||||
local_media_directory: str,
|
||||
filepaths: MediaFilePaths,
|
||||
storage_providers: Sequence["StorageProviderWrapper"],
|
||||
storage_providers: Sequence["StorageProvider"],
|
||||
):
|
||||
self.hs = hs
|
||||
self.reactor = hs.get_reactor()
|
||||
|
@ -360,7 +359,7 @@ class ReadableFileWrapper:
|
|||
clock: Clock
|
||||
path: str
|
||||
|
||||
async def write_chunks_to(self, callback: Callable[[bytes], None]) -> None:
|
||||
async def write_chunks_to(self, callback: Callable[[bytes], object]) -> None:
|
||||
"""Reads the file in chunks and calls the callback with each chunk."""
|
||||
|
||||
with open(self.path, "rb") as file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue