Skip to content

Commit ecb44fd

Browse files
committed
Update endpoint tests to work with botocore 1.23.x
Verify endpoints are a subset of the data we require to account for the new variant keyword added to endpoints.json in botocore 1.23.x. Fixes aws#1850.
1 parent adcc8db commit ecb44fd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/unit/test_awsclient.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
])
2626
def test_resolve_endpoint(stubbed_session, service, region, endpoint):
2727
awsclient = TypedAWSClient(stubbed_session)
28-
assert endpoint == awsclient.resolve_endpoint(service, region)
28+
if endpoint is None:
29+
assert awsclient.resolve_endpoint(service, region) is None
30+
else:
31+
assert endpoint.items() <= awsclient.resolve_endpoint(
32+
service, region).items()
2933

3034

3135
@pytest.mark.parametrize('arn,endpoint', [
@@ -48,7 +52,11 @@ def test_resolve_endpoint(stubbed_session, service, region, endpoint):
4852
])
4953
def test_endpoint_from_arn(stubbed_session, arn, endpoint):
5054
awsclient = TypedAWSClient(stubbed_session)
51-
assert endpoint == awsclient.endpoint_from_arn(arn)
55+
if endpoint is None:
56+
assert awsclient.endpoint_from_arn(arn) is None
57+
else:
58+
assert endpoint.items() <= awsclient.endpoint_from_arn(
59+
arn).items()
5260

5361

5462
@pytest.mark.parametrize('service,region,dns_suffix', [

0 commit comments

Comments
 (0)