Skip to main content

pytest plugin for AWS ApiGateway

Project description

pytest-aws-apigateway

PyPI - Version PyPI - Python Version


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

import httpx

from pytest_aws_apigateway import ApiGateway

def test_handler(apigateway: ApiGateway):

    def handler(event, context):
        return httpx.Response(200, json={"body": "hello"})

    apigateway.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_aws_apigateway-0.2.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

pytest_aws_apigateway-0.2.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page