MCPcopy Create free account
hub / github.com/wal-e/wal-e / test_subdomain_compatible

Function test_subdomain_compatible

tests/test_s3_calling_format.py:99–117  ·  view source on GitHub ↗

Exercise a case where connecting is region-oblivious.

()

Source from the content-addressed store, hash-verified

97
98@pytest.mark.skipif("no_real_s3_credentials()")
99def test_subdomain_compatible():
100 """Exercise a case where connecting is region-oblivious."""
101 creds = Credentials(os.getenv('AWS_ACCESS_KEY_ID'),
102 os.getenv('AWS_SECRET_ACCESS_KEY'))
103
104 bucket_name = bucket_name_mangle('wal-e-test-us-west-1-no-dots')
105
106 cinfo = calling_format.from_store_name(bucket_name)
107
108 with FreshBucket(bucket_name,
109 host='s3-us-west-1.amazonaws.com',
110 calling_format=connection.OrdinaryCallingFormat()) as fb:
111 fb.create(location='us-west-1')
112 conn = cinfo.connect(creds)
113
114 assert cinfo.region is None
115 assert cinfo.calling_format is connection.SubdomainCallingFormat
116 assert isinstance(conn.calling_format,
117 connection.SubdomainCallingFormat)
118
119
120def test_ipv4_detect():

Callers

nothing calls this directly

Calls 5

bucket_name_mangleFunction · 0.90
FreshBucketClass · 0.90
CredentialsClass · 0.50
createMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected