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
+3 -3
View File
@@ -19,11 +19,11 @@ def main():
alice, bob, eve, chat = c.bootstrap()
content = (ROOT / 'tests/fixtures/sample.png').read_bytes()
result = c.call('POST', '/api/v1/chats/' + chat['id'] + '/attachments?filename=sample.png',
201, actor=alice, raw=content, headers={'Content-Type': 'image/png'}, schema='Attachment')
attachment = result['json']
202, actor=alice, raw=content, headers={'Content-Type': 'image/png'}, schema='Attachment')
attachment = c.wait_ready(bob, result['json'])
target = result['headers']['X-Instance-Id']
c.message(alice, chat, '', attachments=[attachment['id']])
print('Upload: 201 ready; instance=' + target, flush=True)
print('Upload: 202 queued, then ready; instance=' + target, flush=True)
# Probe the real known object anonymously from the internal network, not an unknown key.
probe = subprocess.run(['docker', 'compose', 'exec', '-T', 'lb', 'wget', '-S', '-O', '/dev/null',
'http://s3:9000/' + os.environ.get('S3_BUCKET', 'messenger-attachments') + '/originals/' + attachment['id']],