Don't stringify, parameter order broken on Python 3.7

pull/34/head
Simon Willison 2021-11-10 19:33:32 -08:00
rodzic f444ef1ba1
commit c75d418e2e
1 zmienionych plików z 17 dodań i 11 usunięć

Wyświetl plik

@ -406,18 +406,24 @@ def test_create_duration(
' "SessionToken": "session"\n' ' "SessionToken": "session"\n'
"}\n" "}\n"
) )
assert [str(c) for c in mocked_for_duration.mock_calls] == [ assert mocked_for_duration.mock_calls == [
"call('s3')", call("s3"),
"call('iam')", call("iam"),
"call('sts')", call("sts"),
"call().head_bucket(Bucket='pytest-bucket-simonw-1')", call().head_bucket(Bucket="pytest-bucket-simonw-1"),
"call().get_caller_identity()", call().get_caller_identity(),
"call().get_role(RoleName='s3-credentials.AmazonS3FullAccess')", call().get_role(RoleName="s3-credentials.AmazonS3FullAccess"),
"call().assume_role(RoleArn='arn:::role', RoleSessionName='s3.{fragment}.pytest-bucket-simonw-1', Policy='{policy}', DurationSeconds=900)".format( call().assume_role(
fragment=expected_name_fragment, RoleArn="arn:::role",
policy=expected_policy.replace( RoleSessionName="s3.{fragment}.pytest-bucket-simonw-1".format(
"$!BUCKET_NAME!$", "pytest-bucket-simonw-1" fragment=expected_name_fragment
), ),
Policy="{policy}".format(
policy=expected_policy.replace(
"$!BUCKET_NAME!$", "pytest-bucket-simonw-1"
),
),
DurationSeconds=900,
), ),
] ]