Skip to content

Commit 34fc14e

Browse files
Fix Translate PDF test regex matches
Assisted-by: Codex
1 parent 73d94af commit 34fc14e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/live/test_live_translate_pdf_text.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ def test_live_translate_pdf_text_invalid_output_format(
6767
base_url=pdfrest_live_base_url,
6868
) as client:
6969
uploaded = client.files.create_from_paths([resource])[0]
70-
with pytest.raises(PdfRestApiError, match=r"(?i)output\s*format"):
70+
with pytest.raises(
71+
PdfRestApiError,
72+
match=r"invalid-format is not a valid input for 'output_format'",
73+
):
7174
client.translate_pdf_text(
7275
uploaded,
7376
output_language="es",
@@ -86,7 +89,10 @@ async def test_live_async_translate_pdf_text_invalid_output_format(
8689
base_url=pdfrest_live_base_url,
8790
) as client:
8891
uploaded = (await client.files.create_from_paths([resource]))[0]
89-
with pytest.raises(PdfRestApiError, match=r"(?i)output\s*format"):
92+
with pytest.raises(
93+
PdfRestApiError,
94+
match=r"invalid-format is not a valid input for 'output_format'",
95+
):
9096
await client.translate_pdf_text(
9197
uploaded,
9298
output_language="de",

0 commit comments

Comments
 (0)