Skip to content

Commit 5e18a2d

Browse files
tests/live: Sanitize passphrase input in test_live_sign_pdf
- Strip whitespace from the passphrase file content to prevent errors. - Updated `client.files.create` to include sanitized passphrase data within the payload. Assisted-by: Codex
1 parent 7f0a1e0 commit 5e18a2d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/live/test_live_sign_pdf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ def uploaded_passphrase(
4848
pdfrest_live_base_url: str,
4949
) -> PdfRestFile:
5050
resource = get_test_resource_path("signing_passphrase.txt")
51+
sanitized_passphrase = resource.read_text(encoding="utf-8").strip()
5152
with PdfRestClient(
5253
api_key=pdfrest_api_key,
5354
base_url=pdfrest_live_base_url,
5455
) as client:
55-
return client.files.create_from_paths([resource])[0]
56+
return client.files.create(
57+
[(resource.name, sanitized_passphrase.encode("utf-8"), "text/plain")]
58+
)[0]
5659

5760

5861
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)