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

Function random_bucket_name

awscli/testutils.py:265–276  ·  view source on GitHub ↗

Generate a random S3 bucket name. :param prefix: A prefix to use in the bucket name. Useful for tracking resources. This default value makes it easy to see which buckets were created from CLI integ tests. :param num_random: Number of random chars to include in the bucket n

(prefix='awscli-s3integ', num_random=15)

Source from the content-addressed store, hash-verified

263
264
265def random_bucket_name(prefix='awscli-s3integ', num_random=15):
266 """Generate a random S3 bucket name.
267
268 :param prefix: A prefix to use in the bucket name. Useful
269 for tracking resources. This default value makes it easy
270 to see which buckets were created from CLI integ tests.
271 :param num_random: Number of random chars to include in the bucket name.
272
273 :returns: The name of a randomly generated bucket name as a string.
274
275 """
276 return f"{prefix}-{random_chars(num_random)}-{int(time.time())}"
277
278
279class BaseCLIDriverTest(unittest.TestCase):

Callers 7

test_no_sign_requestMethod · 0.90
test_no_paginate_argMethod · 0.90
test_plugin.pyFile · 0.90
test_mb_rbMethod · 0.90
create_bucketFunction · 0.70
create_dir_bucketFunction · 0.70

Calls 2

random_charsFunction · 0.70
timeMethod · 0.45

Tested by

no test coverage detected