From 6302389094c2d3e0bffb45f663e061400a4d5e1b Mon Sep 17 00:00:00 2001 From: Ryan Barnes Date: Thu, 16 May 2024 14:42:14 +1000 Subject: [PATCH] fix(playwright): fix papersize argument --- README.md | 2 +- lambda_function.py | 2 +- tests/test_lambda_e2e.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73b8b07..5875e33 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Event payload body. | **document_url** | url | Fetch the html content from `document_url` to disk before rendering. | | **browser_url** | url | Browser the `browser_url` with `playwright` before rendering with `renderer` | | **browser_headers** | Mapping[str,str] | Add additional headers to playwright before visiting `browser_url` | -| **browser_papersize** | `A4` or `letter` | Size of the page when creating PDF with playwright | | +| **browser_papersize** | `A4` or `Letter` | Size of the page when creating PDF with playwright | | | **renderer** | `princexml` or `playwright` | Renderer to render the html with | | **bucket_name** | string | Output the resulting pdf to `s3://{bucket_name}/{uuid}.pdf`. The lambda will require permission to upload to the bucket. The response will include `bucket`, `key`, `presigned_url` | | **presigned_url** | url | Output the resulting pdf to the presigned url. Generate the presigned url with `put_object`. See Output for more information. | diff --git a/lambda_function.py b/lambda_function.py index 60d6457..c5afac5 100644 --- a/lambda_function.py +++ b/lambda_function.py @@ -41,7 +41,7 @@ class Renderers(str, enum.Enum): class Papersize(str, enum.Enum): A4 = "A4" - Letter = "letter" + Letter = "Letter" class Payload(pydantic.BaseModel): diff --git a/tests/test_lambda_e2e.py b/tests/test_lambda_e2e.py index 2b9afc1..cefd606 100644 --- a/tests/test_lambda_e2e.py +++ b/tests/test_lambda_e2e.py @@ -54,7 +54,7 @@ def test_check_license_returns_a_license_payload() -> None: @pytest.mark.parametrize("renderer", ["princexml", "playwright"]) -@pytest.mark.parametrize("browser_papersize", ["A4", "letter"]) +@pytest.mark.parametrize("browser_papersize", ["A4", "Letter"]) class TestRenderers: def test_generating_pdf_from_document_url(self, renderer: str, browser_papersize: str): s3_client = get_s3_client()