Posts

Showing posts with the label integration

An easy way to integration test your calls to S3 with moto


Integration test boto3 methods with moto mock_s3

Moto is a great package to mock AWS services and I think it is an easy way to have integration tests for your - non-critical - code that interacts with AWS like e.g. boto3-related calls. In our example with have a custom method that creates a AWS S3 bucket. Using the moto.mock_s3 decorator on our test method automatically mocks all calls to S3.


Github gist with code

dependencies: python3.9, boto3 ==1.24.51, moto==3.1.18