A small Python library that includes details mocks of AWS Lambda event sources.
Project description
Event Mocks Python
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 Event Mocks Python using:
pip install git+ssh://git@github.com:Abir-H/serverless-event-mocks.git
Import and use the create_event
function into any Python code using
from serverless_event_mocks.event import create_event
provider = 'aws'
event_type = 'api_gateway'
event_payload = {
"body" : {
"first_name": "Sam",
"last_name": "Smith"
}
}
event = create_event(provider, event_type, event_payload)
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
Close
Hashes for serverless-event-mocks-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b04accca7792820622e5377db218c7c3475db5d4a483871f1dc45baea8d2b4b |
|
MD5 | 7f6405ea6312453e3969973cf0787dbd |
|
BLAKE2b-256 | 3512603d98cdb4c50bcf9074734e6da60db7ac6f74933fee0121062cd78c167f |