Completed for a grade of three
This commit is contained in:
@@ -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']],
|
||||
|
||||
Reference in New Issue
Block a user