moto cognito sign_up函数不起作用

时间:2019-12-24 05:48:40

标签: amazon-web-services boto3 moto

使用pytest.fixtures和mock_cognitoidp

@pytest.fixture(scope="function") def cognito(aws_credentials): import moto with moto.mock_cognitoidp(): yield boto3.client('cognito-idp', region_name='us-east-1')
  def test_cognito(cognito): client_name = str(uuid.uuid4()) value = str(uuid.uuid4) user_pool_id = cognito.create_user_pool(PoolName=str(uuid.uuid4()))["UserPool"]["Id"] user_pool_client_id = cognito.create_user_pool_client( UserPoolId=user_pool_id, ClientName=client_name, CallbackURLs=[value] )['UserPoolClient']['ClientId'] Username=str(uuid.uuid4()) UserAttributes=[ {"Name":"full_name", 'Value':"Satej Sarker"} ] obj={ "ClientId": user_pool_client_id, "Username":Username, "Password":'satejsarker' } user=cognito.sign_up(ClientId=user_pool_client_id, Username=username, Password="abc1234"

它给我的错误,例如sign_up尚未实现 但与其他模块完美配合。并在实际的AWS环境中使用此代码

1 个答案:

答案 0 :(得分:0)

此方法在moto库中未实现。

here是相同的公开github问题。

它可以在活着的aws中工作,因为在这种情况下,它不使用moto。