pytest plugin for AWS ApiGateway
Project description
pytest-aws-apigateway
Rationale
pytest_aws_apigateway
is a pytest plugin to make testing AWS lambda integrations with API Gateway easier.
Installation
pip install pytest-aws-apigateway
Usage
def test_root_resource(apigateway_mock: ApiGatewayMock):
def handler(event, context):
return {"statusCode": 200, "body": json.dumps({"body": "hello"})}
apigateway_mock.add_integration(
"/", handler=handler, method="GET", endpoint="https://some/"
)
with httpx.Client() as client:
resp = client.get("https://some/")
assert resp.json() == {"body": "hello"}
License
pytest-aws-apigateway
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytest_aws_apigateway-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab5ea44a95575ef28c0a45f62cbfd51a84e66511f7c3e478404dc476eb63b238 |
|
MD5 | 2731cd432d2d1d184151ae6e17ab5d48 |
|
BLAKE2b-256 | 73b653f0176e711a94ccbf9fa8a3f609349134a731f181db5fa10eb06bcdb38c |
Close
Hashes for pytest_aws_apigateway-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd859a288a539e384694b5e2dd6ac980ce27b55b05ccf8c2a9a2eaf0656ea49 |
|
MD5 | 352d4933695fe6e1e51f0b5d686785ad |
|
BLAKE2b-256 | 6df0dd9492ff29d6f814bb2f4c6fc9bd0f044dde8092888cccef0721ddedfb5c |