0

I need to make certain assertions in my unit tests about if particular DynamoDB tables were queried/mutated during a request. Is there any way I can intercept/hook-into boto3 calls to DynamoDB or maybe there's some kind of access log so I could read and check it in my tests?

I'm using moto for mocking my unit tests and cannot leverage any real AWS infrastructure in the tests.

Gleb Kisenkov
  • 37
  • 1
  • 7
  • [`moto.dynamodb`](https://docs.getmoto.org/en/latest/docs/services/dynamodb.html) allows to mock out db access. Other than that, please add a [mcve] with a specific problem you have. – hoefling Feb 06 '22 at 14:06
  • You could probably use Botocore Events: https://botocore.amazonaws.com/v1/documentation/api/latest/topics/events.html to intercept and count requests. Note that Moto uses this mechanism as well, so be careful not to overwrite/cancel their event handler – Bert Blommers Feb 06 '22 at 14:40

0 Answers0