16 lines
881 B
Python
16 lines
881 B
Python
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')
|