#NEWLINE# @ pytest . mark . skipif ( 'no_real_s3_credentials()' ) #NEWLINE# def test_sigv4_only_region( tmpdir , monkeypatch ) : #NEWLINE# #INDENT# monkeypatch . setenv ( 'AWS_REGION' , 'eu-central-1' ) #NEWLINE# sigv4_check_apply ( ) #NEWLINE# bucket_name = bucket_name_mangle ( 'sigv4' ) #NEWLINE# creds = Credentials ( os . getenv ( 'AWS_ACCESS_KEY_ID' ) , os . getenv ( 'AWS_SECRET_ACCESS_KEY' ) ) #NEWLINE# cinfo = calling_format . from_store_name ( bucket_name ) #NEWLINE# conn = cinfo . connect ( creds ) #NEWLINE# try : #NEWLINE# #INDENT# conn . create_bucket ( bucket_name , location = 'eu-central-1' ) #NEWLINE# #UNINDENT# except boto . exception . S3CreateError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# source = unicode ( tmpdir . join ( 'source' ) ) #NEWLINE# contents = ( 'abcdefghijklmnopqrstuvwxyz\n' * 100 ) #NEWLINE# with open ( source , 'wb' ) as f : #NEWLINE# #INDENT# f . write ( contents ) #NEWLINE# #UNINDENT# data_url = 's3://{0}/data' . format ( bucket_name ) #NEWLINE# with open ( source ) as f : #NEWLINE# #INDENT# uri_put_file ( creds , data_url , f ) #NEWLINE# #UNINDENT# results = uri_get_file ( creds , contents ) #NEWLINE# assert ( contents == results )