Port final lab 5 validation, session and PNG recovery fixes

This commit is contained in:
Artyom
2026-11-07 02:35:40 +03:00
parent 97feb04b3f
commit bc1d7aa771
41 changed files with 4363 additions and 53 deletions
+5 -1
View File
@@ -12,7 +12,7 @@ from PIL import Image
from conftest import actor, make_chat, register, resolve, running_app, scalar
from fakes import MemoryObjectStorage
from messenger.attachments.application.ports import ObjectStorage
from pictures import GIF, JPEG, SAMPLE, WEBP, png
from pictures import BROKEN_PNG, DUPLICATE_IHDR_PNG, GIF, JPEG, SAMPLE, WEBP, png
from pipeline import settle
LIMIT = 10_485_760
@@ -197,6 +197,8 @@ async def test_pixel_limit_is_read_from_header(
@pytest.mark.parametrize(
("content", "header"),
[
(BROKEN_PNG, "image/png"),
(DUPLICATE_IHDR_PNG, "image/png"),
(JPEG, "image/png"),
(GIF, "image/png"),
(WEBP, "image/png"),
@@ -209,6 +211,8 @@ async def test_pixel_limit_is_read_from_header(
(SAMPLE, "image/gif"),
],
ids=[
"invalid-zlib",
"duplicate-ihdr",
"jpeg-as-png",
"gif-as-png",
"webp-as-png",