Добавить панель обработки изображений

This commit is contained in:
Никита
2026-11-10 11:04:44 +03:00
parent ea17657202
commit 0e0efe5614
6 changed files with 126 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
from support import *
c=Client('http://localhost:18085')
a,b,e,chat=c.bootstrap()
attachment=upload(c,a,chat)['json'];meta=ready(c,b,attachment)
path='/api/v1/attachments/'+attachment['id']+'/processing'
for actor in (a,b):
job=parsed(c,'GET',path,actor=actor)
check(job['state']=='ready' and job['attempts']>=1,'job state missing')
check(job['completed_at'] and any(event['name']=='ready' for event in job['events']),'completion missing')
check('staging_key' not in job and 'lease_token' not in job,'internal details exposed')
c.call('GET',path,404,actor=e)
c.call('GET',path,401)
c.message(a,chat,'Изображение с результатами обработки',attachments=[attachment['id']])
(ROOT/'.local/processing-user.json').write_text(json.dumps(a['registration']))
print('PASS: processing states/events available to chat members; stranger 404; anonymous 401')