Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mock AWS services for testing

I am looking for ways to test AWS services without actually using AWS cloud. Python is the language of choice.

Using some mock components which will let me test my code which uses AWS S3, Redshift, Lambda, Dynamodb etc

So far I have found,

  1. Localstack (This supports most of the AWS services)
  2. Minio - This one supports S3 and Lambda
  3. s3rver - supports only AWS S3

Are there any other options?

like image 472
shrishinde Avatar asked Aug 02 '17 14:08

shrishinde


People also ask

Is a library that allows your tests to easily mock out AWS Services?

In a nutshell Moto is a library that allows your tests to easily mock out AWS Services. Take a minute to think how you would have tested that in the past. With the decorator wrapping the test, all the calls to s3 are automatically mocked out. The mock keeps the state of the buckets and keys.

What is mock in AWS?

The mock integration allows you to use mapping templates to generate the output of your API method without having to communicate with a backend. The mock integration feature is available in the Amazon API Gateway console.

What is Moto AWS?

Moto - Mock AWS Services Moto is a library that allows your tests to easily mock out AWS Services. Imagine you have the following python code that you want to test: import boto3 class MyModel(object): def __init__(self, name, value): self. name = name self.


1 Answers

Are you using boto3 to access the AWS resources? If so, it sounds like moto is perfect for what you need https://github.com/spulec/moto

like image 196
michael_erasmus Avatar answered Oct 04 '22 20:10

michael_erasmus