MCPcopy
hub / github.com/aws/aws-cli / assert_key_contents_equal

Method assert_key_contents_equal

tests/__init__.py:549–560  ·  view source on GitHub ↗
(self, bucket, key, expected_contents)

Source from the content-addressed store, hash-verified

547 return client
548
549 def assert_key_contents_equal(self, bucket, key, expected_contents):
550 self.wait_until_key_exists(bucket, key)
551 if isinstance(expected_contents, BytesIO):
552 expected_contents = expected_contents.getvalue().decode('utf-8')
553 actual_contents = self.get_key_contents(bucket, key)
554 # The contents can be huge so we try to give helpful error messages
555 # without necessarily printing the actual contents.
556 assert len(actual_contents) == len(expected_contents)
557 assert actual_contents == expected_contents, (
558 f"Contents for {bucket}/{key} do not match (but they "
559 f"have the same length)"
560 )
561
562 def create_bucket(self, name=None, region=None):
563 if not region:

Calls 4

wait_until_key_existsMethod · 0.95
get_key_contentsMethod · 0.95
decodeMethod · 0.80
getvalueMethod · 0.45

Tested by 9

test_mv_local_to_s3Method · 0.36
test_sse_uploadMethod · 0.36
test_sse_copyMethod · 0.36