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:
David Robertson 2023-02-07 15:24:44 +00:00 committed by GitHub
parent 4dd2b6165c
commit 2dff93099b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 23 deletions

View file

@ -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: