test(student):lab4 attachments negative cases

- 11 MiB body -> 413 payload_too_large
- truncated PNG -> 415 unsupported_media_type
- MIME mismatch (PNG bytes as image/jpeg) -> 201, content_type image/png
- outsider access to metadata and bytes -> 404
- foreign-chat attachment_id in message -> 404
- 11 attachment_ids -> 400 invalid_request
- duplicate attachment_ids -> 400 invalid_request
- empty filename -> 400
- path-traversal / backslash / NUL in filename -> 400
All rejections are 4xx; no 500 on user error.
This commit is contained in:
Голиков Maximillian Антон
2026-10-23 11:15:42 +03:00
parent 6c78efa17d
commit e799879f9e
2 changed files with 105 additions and 2 deletions
+1 -2
View File
@@ -5,8 +5,7 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parent
QUICK = ('test_cases.py', 'test_concurrency.py', 'test_auth.py')
QUICK = ('test_cases.py', 'test_concurrency.py', 'test_auth.py', 'test_attachments.py')
def main():
args = sys.argv[1:]