DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Unit Testing AWS Lambda with Python and Mock AWS Services

2 years ago aws.amazon.com
Unit Testing AWS Lambda with Python and Mock AWS Services

Summary: This is a summary of an article originally published by AWS DevOps Blog. Read the full original article here →

When building serverless event-driven applications using https://aws.amazon.com/lambda/, it is best practice to validate individual components. Unit testing can quickly identify and isolate issues in AWS Lambda function code. The techniques outlined in this blog demonstrates unit test techniques for Python-based AWS Lambda functions and interactions with AWS Services.

In production, our Lambda function code will directly access the AWS resources we defined in our function handler; however, in our unit tests we want to isolate our code and replace the AWS resources with simulations.

We’ve seen in this blog how to unit test AWS Lambda functions and mock AWS Services to isolate and test individual logic within our code.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com