Skip to content

Commit 0b23619

Browse files
msch-nutrientclaude
andcommitted
Refactor test PDF data to external file
Move inline PDF content from test_live_api.py to separate file to improve code readability and fix long line issue. Also fix unused variable warning. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e74244d commit 0b23619

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/data/sample.pdf

297 Bytes
Binary file not shown.

tests/integration/test_live_api.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ def client(self):
3030
client.close()
3131

3232
@pytest.fixture
33-
def sample_pdf_path(self, tmp_path):
34-
"""Create a simple PDF file for testing."""
35-
pdf_content = b"%PDF-1.4\n1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj 3 0 obj<</Type/Page/Parent 2 0 R/MediaBox[0 0 612 792]>>endobj xref 0 4 0000000000 65535 f 0000000010 00000 n 0000000053 00000 n 0000000125 00000 n trailer<</Size 4/Root 1 0 R>>startxref 177 %%EOF"
36-
pdf_path = tmp_path / "test.pdf"
37-
pdf_path.write_bytes(pdf_content)
38-
return str(pdf_path)
33+
def sample_pdf_path(self):
34+
"""Get path to sample PDF file for testing."""
35+
import os
36+
return os.path.join(os.path.dirname(__file__), "..", "data", "sample.pdf")
3937

4038
def test_client_initialization(self):
4139
"""Test that client initializes correctly with API key."""
@@ -60,9 +58,8 @@ def test_basic_api_connectivity(self, client, sample_pdf_path):
6058
@pytest.mark.skip(reason="Requires specific tool implementation")
6159
def test_convert_operation(self, client, sample_pdf_path, tmp_path):
6260
"""Test a basic convert operation (example - adjust based on available tools)."""
63-
output_path = tmp_path / "output.pdf"
64-
6561
# This is an example - adjust based on actual available tools
62+
# output_path = tmp_path / "output.pdf"
6663
# result = client.convert_to_pdf(input_file=sample_pdf_path, output_path=str(output_path))
6764

6865
# assert output_path.exists()

0 commit comments

Comments
 (0)