fix: ignore some type checks in test file
This commit is contained in:
parent
5b248cd46b
commit
fdf878d2e3
@ -129,8 +129,8 @@ def test_file_delete(media_repo: MediaRepository, mock_db_conn: Tuple[Any, Any])
|
||||
assert file.delete() is True
|
||||
assert not file_path.exists()
|
||||
|
||||
media_repo._execute.assert_any_call("DELETE from mediaapi_thumbnail WHERE media_id=%s;", ("mxid123",))
|
||||
media_repo._execute.assert_any_call("DELETE from mediaapi_media_repository WHERE media_id=%s;", ("mxid123",))
|
||||
media_repo._execute.assert_any_call("DELETE from mediaapi_thumbnail WHERE media_id=%s;", ("mxid123",)) # type: ignore
|
||||
media_repo._execute.assert_any_call("DELETE from mediaapi_media_repository WHERE media_id=%s;", ("mxid123",)) # type: ignore
|
||||
|
||||
|
||||
def test_get_single_media(media_repo: MediaRepository, mock_db_conn: Tuple[Any, Any]) -> None:
|
||||
@ -143,7 +143,7 @@ def test_get_single_media(media_repo: MediaRepository, mock_db_conn: Tuple[Any,
|
||||
assert file.media_id == "mxid123"
|
||||
assert file.base64hash == "abc123"
|
||||
|
||||
media_repo._execute.assert_called_with(
|
||||
media_repo._execute.assert_called_with( # type: ignore
|
||||
"SELECT media_id, creation_ts, base64hash, file_size_bytes from mediaapi_media_repository WHERE media_id = %s;",
|
||||
("mxid123",),
|
||||
)
|
||||
@ -278,7 +278,7 @@ def test_get_local_user_media(media_repo: MediaRepository, mock_db_conn: Tuple[A
|
||||
assert files[0].media_id == "media1"
|
||||
assert files[1].media_id == "media2"
|
||||
|
||||
media_repo._execute.assert_called_with(
|
||||
media_repo._execute.assert_called_with( # type: ignore
|
||||
"SELECT media_id, creation_ts, base64hash, file_size_bytes FROM mediaapi_media_repository WHERE user_id = %s;",
|
||||
("@user:domain.com",),
|
||||
)
|
||||
@ -407,7 +407,7 @@ def test_file_has_thumbnails(media_repo: MediaRepository, mock_db_conn: Tuple[An
|
||||
|
||||
file = File(media_repo, "mxid123", 1600000000, "abc123", 1000)
|
||||
assert file.has_thumbnail() == 3 # noqa PLR2004
|
||||
media_repo._execute.assert_called_with(
|
||||
media_repo._execute.assert_called_with( # type: ignore
|
||||
"SELECT COUNT(media_id) FROM mediaapi_thumbnail WHERE media_id = %s;",
|
||||
("mxid123",),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user