Reputation: 116
In the latest moto version @mock_dynamodb and @mock_dynamodb2 are depricated and removed. Can someone please share an example of mocking and unit testing dynamodb operation from AWS Lambda using moto. Found a few examples using @mock_aws, but nothing concrete.
Upvotes: 3
Views: 1454
Reputation: 2123
The behaviour is mostly the same between v4 and v5 - you just have to replace mock_dynamodb
with mock_aws
.
There are a ton of unit tests in the Moto project that you can use as examples though: https://github.com/getmoto/moto/blob/master/tests/test_dynamodb/test_dynamodb.py
Upvotes: 3