Serverless FastAPI Testing: Use Moto and Just Mock It!

Serverless FastAPI Testing: Use Moto and Just Mock It!

In my previous blog post Serverless FastAPI Development: Building Player FC API on AWS, we explored creating and deploying a FastAPI application on AWS. In this blog post we’ll take a look at testing our app locally.

We write tests to prove that our code works as designed, however since our code interacts with cloud services it’s somewhat of a challenge to mock tests to the cloud without actually making api calls that traverse the internet, well that is unless you use Moto.

Moto is a Python library that mocks AWS services, allowing you to test without making real API calls.

Read more