Completed for a grade of three
This commit is contained in:
@@ -60,8 +60,9 @@ def main():
|
||||
client = Client(timeout=60)
|
||||
barrier.wait(timeout=30)
|
||||
result = client.call('POST', '/api/v1/chats/' + chat['id'] + '/attachments?filename=load.png',
|
||||
201, actor=alice, raw=data, headers={'Content-Type': 'image/png'}, schema='Attachment')
|
||||
202, actor=alice, raw=data, headers={'Content-Type': 'image/png'}, schema='Attachment')
|
||||
check(result['json']['sha256'] == expected, 'uploaded checksum mismatch')
|
||||
client.wait_ready(bob, result['json'])
|
||||
downloaded = client.call('GET', '/api/v1/attachments/' + result['json']['id'] + '/content', actor=bob)
|
||||
check(hashlib.sha256(downloaded['bytes']).hexdigest() == expected, 'download checksum mismatch')
|
||||
return {'upload': index, 'seconds': round(result['elapsed'], 3), 'instance': result['headers']['X-Instance-Id']}
|
||||
|
||||
Reference in New Issue
Block a user