python-lambda
python-lambda copied to clipboard
Testing multiple events together
I was thinking that it would be very useful to be able to test multiple events in a row instead of just one, like a test battery. Of course I could just write a simply script on my local machine, but it sounds like an interesting feature to add to the library.
In order to keep the events separate (so that you can also unit test), I was thinking of a command to invoke all events in a directory for example. I'd even say that it should be the default behaviour of lambda invoke, since having only one event.json isn't a very useful feature. In this case, lambda init would create an events directory, with inside a single default event.json, in order to make the transition as clean as possible for future users.
lambda invoke would then by default run all the events sequentially, and would still accept the filename parameter to only run one event
I'd be open to make a PR for this when I get the time if we can agree on the structure
Hey. This is a really good suggestion as a feature. For most lambda, I have multiple copies of event.json renamed with numbers attached.
@nficano Thoughts ?