Completed for a grade of three

This commit is contained in:
2026-11-18 13:55:24 +03:00
parent cd84a6fd36
commit 248f8a5cb0
77 changed files with 4100 additions and 251 deletions
+2 -1
View File
@@ -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']}