Skip to main content

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

Metadata

Release files for serverless-event-mocks 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serverless-event-mocks 0.0.7
File Size Uploaded
serverless-event-mocks-0.0.7.tar.gz 3.4 kB Details

Release files / serverless-event-mocks-0.0.7.tar.gz

Download URL serverless-event-mocks-0.0.7.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aa4bb693a284f10aea38a2204314b795679f7990cdd9d07041e6e8beb0e96104
BLAKE2b-256 checksum
How to use checksums
c7a6a6695addd0fab044462bace3264bd746e0c0441395eb43f430a745d9fee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page