garnaat / placebo

Make boto3 calls that look real but have no effect.
Apache License 2.0
394 stars 28 forks source link

Consider using `moto` for `placebo` unit tests #39

Open vlcinsky opened 8 years ago

vlcinsky commented 8 years ago

placebo provides feature to save recorded requests, but for this it has to talk to real AWS service to get some response what requires some credentials being in place and also breaks the assumption that unit test shall not be dependent on other things around.

In my current PR #37 I have a problem, that the test case is failing in different way in my own environment and at Travis.

In current test suite I also did not find a test, which would save responses by calling some real boto3 operations - all recordings is done by pill.save_response call.

Do you feel, moto could serve as solution for this? We could use moto to create a S3 bucket, put there some objects and expect AWS calls in test case to use this mocked service.

What do you think of it?

kapilt commented 8 years ago

placebo is an alternative to moto, yes recording does require interacting with the service, after initial record, ie in playback mode, no external interaction is needed. moto has a different interaction, of mocking/stubbing the aws api the but is also much more fragile wrt to services and usages, where as placebo has fairly complete and robust coverage imo.