def test_bucket_exists(self):
    bucket = ('test-bucket-%s' % short_uid())
    s3_client = aws_stack.connect_to_service('s3')
    s3_client.create_bucket(Bucket=bucket)
    s3_client.put_bucket_cors(Bucket=bucket, CORSConfiguration={'CORSRules': [{'AllowedMethods': ['GET', 'POST', 'PUT', 'DELETE'], 'AllowedOrigins': ['localhost']}]})
    response = s3_client.get_bucket_cors(Bucket=bucket)
    self.assertEqual(response['ResponseMetadata']['HTTPStatusCode'], 200)
    s3_client.delete_bucket(Bucket=bucket)
def test_bucket_exists(self):
    bucket = ('test-bucket-%s' % short_uid())
    s3_client = aws_stack.connect_to_service('s3')
    s3_client.create_bucket(Bucket=bucket)
    s3_client.put_bucket_cors(Bucket=bucket, CORSConfiguration={'CORSRules': [{'AllowedMethods': ['GET', 'POST', 'PUT', 'DELETE'], 'AllowedOrigins': ['localhost']}]})
    response = s3_client.get_bucket_cors(Bucket=bucket)
    self.assertEqual(response['ResponseMetadata']['HTTPStatusCode'], 200)
    s3_client.delete_bucket(Bucket=bucket)