@pytest.mark.skipif('no_real_s3_credentials()')
def test_subdomain_compatible():
 creds = Credentials(os.getenv('AWS_ACCESS_KEY_ID'), os.getenv('AWS_SECRET_ACCESS_KEY'))
 bucket_name = bucket_name_mangle('wal-e-test-us-west-1-no-dots')
 cinfo = calling_format.from_store_name(bucket_name)
 with FreshBucket(bucket_name, host='s3-us-west-1.amazonaws.com', calling_format=connection.OrdinaryCallingFormat()) as fb:
  fb.create(location='us-west-1')
  conn = cinfo.connect(creds)
  assert (cinfo.region is None)
  assert (cinfo.calling_format is connection.SubdomainCallingFormat)
  assert isinstance(conn.calling_format, connection.SubdomainCallingFormat)

@ pytest . mark . skipif ( 'no_real_s3_credentials()' ) def test_subdomain_compatible ( ) : creds = Credentials ( os . getenv ( 'AWS_ACCESS_KEY_ID' ) , os . getenv ( 'AWS_SECRET_ACCESS_KEY' ) ) bucket_name = bucket_name_mangle ( 'wal-e-test-us-west-1-no-dots' ) cinfo = calling_format . from_store_name ( bucket_name ) with FreshBucket ( bucket_name , host = 's3-us-west-1.amazonaws.com' , calling_format = connection . OrdinaryCallingFormat ( ) ) as fb : fb . create ( location = 'us-west-1' ) conn = cinfo . connect ( creds ) assert ( cinfo . region is None ) assert ( cinfo . calling_format is connection . SubdomainCallingFormat ) assert isinstance ( conn . calling_format , connection . SubdomainCallingFormat )
exercise a case where connecting is region-oblivious .