@mock_s3
def test_create_existing_bucket():
 conn = boto.s3.connect_to_region(u'us-west-2')
 conn.create_bucket(u'foobar')
 with assert_raises(S3CreateError):
  conn.create_bucket(u'foobar')

@ mock_s3 def test_create_existing_bucket ( ) : conn = boto . s3 . connect_to_region ( u'us-west-2' ) conn . create_bucket ( u'foobar' ) with assert_raises ( S3CreateError ) : conn . create_bucket ( u'foobar' )
trying to create a bucket that already exists should raise an error .