def test_can_serialize_cognito_auth(): auth = app.CognitoUserPoolAuthorizer( 'Name', provider_arns=['Foo'], header='Authorization') assert auth.to_swagger() == { 'in': 'header', 'type': 'apiKey', 'name': 'Authorization', 'x-amazon-apigateway-authtype': 'cognito_user_pools', 'x-amazon-apigateway-authorizer': { 'type': 'cognito_user_pools', 'providerARNs': ['Foo'], } }
def test_typecheck_list_type(): with pytest.raises(TypeError): app.CognitoUserPoolAuthorizer('Name', 'Authorization', provider_arns='foo')