powertools-lambda-python icon indicating copy to clipboard operation
powertools-lambda-python copied to clipboard

Document how to unit test idempotency

Open heitorlessa opened this issue 5 years ago • 3 comments

What were you initially searching for in the docs?

How to unit test code when using idempotency utility

Is this related to an existing part of the documentation? Please share a link

Describe how we could make it clearer

Like other utilities, create a section Testing your code with an example test.

If you have a proposed update, please share it here

heitorlessa avatar Aug 21 '21 13:08 heitorlessa

We are facing issues with UT as well.

Our main issue is that, as DynamoDBPersistenceLayer is eager to create table. Every python script that we use this annotation needs have mocks in place in advance. Even to test non annotated methods at the same python file.

My question is:

  • Am i missing something? (This is why i am interacting with this ticket)
  • Should i cut a ticket and raise a PR to make DynamoDBPersistenceLayer to lazy create boto resources?

lucasam avatar Sep 10 '21 19:09 lucasam

Hey @lucasam if you could contribute that would be awesome, as I'm on vacation for two more weeks.

heitorlessa avatar Sep 10 '21 21:09 heitorlessa

Thanks a lot @cakepietoast !!!

heitorlessa avatar Oct 01 '21 15:10 heitorlessa