forked from mtusi2026/mtusi2026lab4
Проверять содержимое изображений: байты фильтра PNG и настоящее декодирование JPEG
This commit is contained in:
@@ -6,7 +6,7 @@ COMPOSE = docker compose --env-file .env
|
||||
COMPOSE_TEST = $(COMPOSE) -f compose.yaml -f compose.test.yaml
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover env up down clean restore student-test test-failures explain failover-each failover-hard rolling-update janitor upload-peak attachment-demo
|
||||
.PHONY: help check validate test load test-persistence test-failover env up down clean restore student-test test-failures explain failover-each failover-hard rolling-update janitor upload-peak attachment-demo test-images
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@@ -84,3 +84,8 @@ upload-peak:
|
||||
# сценарий защиты: файл, сообщение, второй участник, посторонний, прямой GET в S3
|
||||
attachment-demo:
|
||||
$(PYTHON) scripts/attachment_demo.py
|
||||
|
||||
# разбор изображений и сверка с Pillow внутри образа API: там установлен декодер
|
||||
test-images:
|
||||
COPYFILE_DISABLE=1 tar -cf - src/images.py student-tests/samples.py student-tests/image tests/fixtures/sample.png | \
|
||||
docker run --rm -i --entrypoint sh mtusi-messenger:lab4 -c 'cd /tmp && tar -xf - && python -m unittest discover -s student-tests/image -v'
|
||||
|
||||
Reference in New Issue
Block a user