【发布时间】:2022-06-23 20:58:27
【问题描述】:
我正在测试一些用 FastAPI 编写的端点。我使用 pytest 和我编写的夹具中的 dynamoDB 表为命令和查询编写了测试,并且它可以工作。
但是,现在我想使用示例 test_event.json(我需要 requestContext 字段)和命令来测试端点:
serverless invoke local --function API --path test_event.json
我收到以下错误:
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the Query operation: The table does not have the specified index: GS1PK-GS1SK-index
所以,显然 DynamoDB 表没有加载。 有人知道在这种情况下如何使用这些装置吗?
【问题讨论】:
标签: aws-lambda amazon-dynamodb fastapi serverless fixtures