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)
| 263 | |
| 264 | |
| 265 | def 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 | |
| 279 | class BaseCLIDriverTest(unittest.TestCase): |
no test coverage detected