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
- 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.
Source Distribution
File details
Details for the file serverless-event-mocks-0.0.7.tar.gz
.
File metadata
- Download URL: serverless-event-mocks-0.0.7.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa4bb693a284f10aea38a2204314b795679f7990cdd9d07041e6e8beb0e96104 |
|
MD5 | 07ba26541c6cd1fdf32c18957e23b797 |
|
BLAKE2b-256 | c7a6a6695addd0fab044462bace3264bd746e0c0441395eb43f430a745d9fee8 |