feat:report

This commit is contained in:
Оля Мороз
2026-11-16 20:30:12 +03:00
parent 90f407b174
commit c91ec7790f
37 changed files with 1159 additions and 209 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""В Stream нет filename/URL/секретов — только id/version/attempt."""
import json, sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from tests.client import Client, check
from student_tests.common import upload, wait_status, docker, ok, fail
def main():
c = Client()
a, b, e, ch = c.bootstrap()
content = Path('tests/fixtures/sample.png').read_bytes()
upload(c, a, ch, content)
raw = docker('exec', '-T', 'redis', 'redis-cli', '--raw', 'XRANGE', 'attachment.jobs', '-', '+')
ok('stream sample:\n' + raw)
lower = raw.lower()
for bad in ('filename', 'sample.png', 'staging/', 'final/', 'http', 'secret'):
check(bad not in lower, 'broker payload contains forbidden token: %s' % bad)
ok('broker payload has only ids/version/attempt')
if __name__ == '__main__':
try:
main()
except Exception as exc:
fail(str(exc))