MCPcopy Index your code
hub / github.com/aws/aws-cli / put_object

Method put_object

tests/integration/test_cli.py:40–57  ·  view source on GitHub ↗
(
        self,
        bucket,
        key,
        content,
        extra_args=None,
    )

Source from the content-addressed store, hash-verified

38 """
39
40 def put_object(
41 self,
42 bucket,
43 key,
44 content,
45 extra_args=None,
46 ):
47 session = botocore.session.get_session()
48 client = session.create_client('s3', 'us-east-1')
49 client.create_bucket(Bucket=bucket, ObjectOwnership='ObjectWriter')
50 time.sleep(5)
51 client.delete_public_access_block(Bucket=bucket)
52 self.addCleanup(client.delete_bucket, Bucket=bucket)
53 call_args = {'Bucket': bucket, 'Key': key, 'Body': content}
54 if extra_args is not None:
55 call_args.update(extra_args)
56 client.put_object(**call_args)
57 self.addCleanup(client.delete_object, Bucket=bucket, Key=key)
58
59 def test_ec2_describe_instances(self):
60 # Verify we can make a call and get output.

Callers 15

test_no_sign_requestMethod · 0.95
test_no_paginate_argMethod · 0.95
test_no_paginationMethod · 0.45
test_max_itemsMethod · 0.45
test_queryMethod · 0.45
test_no_sign_requestsMethod · 0.45
create_objectMethod · 0.45
assert_can_put_objectMethod · 0.45

Calls 5

create_clientMethod · 0.45
create_bucketMethod · 0.45
sleepMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected