@pytest.mark.skipif('no_real_s3_credentials()')
def test_301_redirect():
 import boto.s3.connection
 bucket_name = bucket_name_mangle('wal-e-test-301-redirect')
 with pytest.raises(boto.exception.S3ResponseError) as e:
  with FreshBucket(bucket_name, calling_format=OrdinaryCallingFormat()) as fb:
   fb.create(location='us-west-1')
 assert (e.value.status == 301)

@ pytest . mark . skipif ( 'no_real_s3_credentials()' ) def test_301_redirect ( ) : import boto . s3 . connection bucket_name = bucket_name_mangle ( 'wal-e-test-301-redirect' ) with pytest . raises ( boto . exception . S3ResponseError ) as e : with FreshBucket ( bucket_name , calling_format = OrdinaryCallingFormat ( ) ) as fb : fb . create ( location = 'us-west-1' ) assert ( e . value . status == 301 )
integration test for bucket naming issues this test .