FEA-Bench / testbed /aws-powertools__powertools-lambda-python /tests /e2e /event_handler /test_openapi.py
| import pytest | |
| from requests import Request | |
| from tests.e2e.utils import data_fetcher | |
| def apigw_rest_endpoint(infrastructure: dict) -> str: | |
| return infrastructure.get("APIGatewayRestUrl", "") | |
| def test_get_openapi_schema(apigw_rest_endpoint): | |
| # GIVEN | |
| url = f"{apigw_rest_endpoint}openapi_schema" | |
| # WHEN | |
| response = data_fetcher.get_http_response( | |
| Request( | |
| method="GET", | |
| url=url, | |
| ), | |
| ) | |
| assert "Powertools e2e API" in response.text | |
| assert "x-amazon-apigateway-gateway-responses" in response.text | |
| assert response.status_code == 200 | |