Skip to main content

pytest-aws-apigateway

PyPI - Version PyPI - Python Version


Rationale

pytest_aws_apigateway is a pytest plugin to make testing AWS Lambda integrations with AWS ApiGateway easier. It registers AWS Lambda function handlers as callbacks to requests made using httpx so you can test your REST API using HTTP requests.

Usage

Add integrations

pytest-aws-apigateway lets you register AWS Lambda function handlers to act just like AWS ApiGateway proxy integrations.

import httpx
from pytest_aws_apigateway import ApiGatewayMock


def handler(event, context):
    return {"statusCode": 200, "body": json.dumps({"message": "Hello World!"})}

def test_hello_world(apigateway_mock: ApiGatewayMock):
    apigateway_mock.add_integration(
        "/", handler=handler, method="GET", endpoint="https://greetings/"
    )

    with httpx.Client() as client:
        resp = client.get("https://greetings/")
        assert resp.json() == {"message": "Hello World!"}

License

pytest-aws-apigateway is distributed under the terms of the MIT license.

Metadata

Release files for pytest-aws-apigateway 0.7.1

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

Source distribution (sdist)

Source distribution for pytest-aws-apigateway 0.7.1
File Size Uploaded
pytest_aws_apigateway-0.7.1.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-aws-apigateway 0.7.1
File Interpreter ABI Platform
pytest_aws_apigateway-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / pytest_aws_apigateway-0.7.1.tar.gz

Download URL pytest_aws_apigateway-0.7.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
45c22929c75157686d41b5aeaeea79bd83a625b16a4b8aba4d212275dd0a34fe
BLAKE2b-256 checksum
How to use checksums
130f5fb0838831f29768d3e28d60af7864d81ea040bd4c8d71684afd332ca86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / pytest_aws_apigateway-0.7.1-py3-none-any.whl

Download URL pytest_aws_apigateway-0.7.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4eed118a82b4d1a4784603fc2d1c0797fe6f3849d1dfd954fb62931fc07523b6
BLAKE2b-256 checksum
How to use checksums
73a513c54982df610d41e7648e155ad8913ac90fd765f95d218ada31a9d37c23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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