Skip to main content

A small Python library that includes details mocks of AWS Lambda event sources.

Project description

Serverless Event Mocks

A small Python library that includes detail mocks of Serverless function events. Useful when unit testing your Serverless functions.

Supported Providers and Event Types:

  • AWS: aws
    • API Gateway: api_gateway

This library simply uses default event source mock templates and merges them with any overwrite you provide. Check out the JSON template files to learn more about the data structure of each event source.


Quick Start - Install via pip

pip install serverless-event-mocks

Usage


API Gateway

from serverless_event_mocks import create_event

event = create_event(
    provider='aws',
    event_type='api_gateway',
    event_payload={
        "body" : {
            "first_name": "Sam",
            "last_name": "Smith"
        }
    }
)

Run Tests and Linter

# Run unit tests
make test

# Run Flake8 linter
make lint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for serverless-event-mocks, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size serverless-event-mocks-0.0.7.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page