Добавил TLS и защиту мессенджера для лабораторной 7
Skeleton contracts / contracts (pull_request) Blocked by required conditions
Skeleton contracts / contracts (pull_request) Blocked by required conditions
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Unit check for the mandatory lab5 thumbnail conversion."""
|
||||
import io
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
from app.worker import _make_thumbnail
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
source = (ROOT / 'tests' / 'fixtures' / 'sample.png').read_bytes()
|
||||
content, width, height = _make_thumbnail(source)
|
||||
with Image.open(io.BytesIO(content)) as thumbnail:
|
||||
assert thumbnail.format == 'JPEG'
|
||||
assert thumbnail.size == (256, 160)
|
||||
assert (width, height) == (256, 160)
|
||||
print('PASS: 320x200 PNG produces a real JPEG thumbnail of 256x160')
|
||||
Reference in New Issue
Block a user