Skip to content

Commit e74244d

Browse files
committed
ruff fix
1 parent 2a230e7 commit e74244d

File tree

5 files changed

+13
-24
lines changed

5 files changed

+13
-24
lines changed

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ def pytest_collection_modifyitems(config, items):
1515
"""Automatically mark integration tests."""
1616
for item in items:
1717
if "integration" in str(item.fspath):
18-
item.add_marker(pytest.mark.integration)
18+
item.add_marker(pytest.mark.integration)

tests/integration/test_live_api.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
These tests require a valid API key configured in integration_config.py.
44
"""
55

6-
import os
76
import pytest
8-
from pathlib import Path
97

108
from nutrient_dws import NutrientClient
11-
from nutrient_dws.exceptions import AuthenticationError
129

1310
try:
1411
from . import integration_config
@@ -64,19 +61,19 @@ def test_basic_api_connectivity(self, client, sample_pdf_path):
6461
def test_convert_operation(self, client, sample_pdf_path, tmp_path):
6562
"""Test a basic convert operation (example - adjust based on available tools)."""
6663
output_path = tmp_path / "output.pdf"
67-
64+
6865
# This is an example - adjust based on actual available tools
6966
# result = client.convert_to_pdf(input_file=sample_pdf_path, output_path=str(output_path))
70-
67+
7168
# assert output_path.exists()
7269
# assert output_path.stat().st_size > 0
7370

7471
def test_builder_api_basic(self, client, sample_pdf_path):
7572
"""Test basic builder API functionality."""
7673
builder = client.build(input_file=sample_pdf_path)
77-
74+
7875
# Test that we can add steps without errors
7976
# This will need to be updated based on actual available tools
8077
# builder.add_step("example-tool", {})
81-
82-
assert builder is not None
78+
79+
assert builder is not None

tests/unit/test_builder.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Unit tests for Builder API."""
22

3-
import pytest
43

54
from nutrient_dws.builder import BuildAPIWrapper
65

@@ -18,7 +17,7 @@ def test_builder_add_step():
1817
"""Test adding steps to builder."""
1918
builder = BuildAPIWrapper(None, "test.pdf")
2019
result = builder.add_step("convert-to-pdf", options={"format": "docx"})
21-
20+
2221
assert result is builder # Should return self for chaining
2322
assert len(builder._actions) == 1
2423
assert builder._actions[0]["type"] == "convert-to-pdf"
@@ -33,7 +32,7 @@ def test_builder_chaining():
3332
.add_step("rotate-pages", options={"degrees": 90})
3433
.add_step("watermark-pdf", options={"text": "DRAFT"})
3534
)
36-
35+
3736
assert result is builder
3837
assert len(builder._actions) == 3
3938
# Actions are transformed by _map_tool_to_action, so check structure exists
@@ -47,7 +46,7 @@ def test_builder_set_output_options():
4746
metadata={"title": "Test Doc"},
4847
optimize=True
4948
)
50-
49+
5150
assert result is builder
5251
assert builder._output_options["metadata"]["title"] == "Test Doc"
5352
assert builder._output_options["optimize"] is True
@@ -57,7 +56,7 @@ def test_builder_execute_requires_client():
5756
"""Test that execute requires a client."""
5857
builder = BuildAPIWrapper(None, "test.pdf")
5958
builder.add_step("convert-to-pdf")
60-
59+
6160
# Without a proper client, this would fail when trying to access client methods
6261
# We can't test the actual failure without mocking, so just ensure the method exists
63-
assert hasattr(builder, "execute")
62+
assert hasattr(builder, "execute")

tests/unit/test_file_handler.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
"""Unit tests for file handling utilities."""
22

33
import io
4-
from pathlib import Path
5-
6-
import pytest
74

85
from nutrient_dws.file_handler import (
96
prepare_file_input,
10-
save_file_output,
11-
stream_file_content,
127
)
138

149

@@ -58,4 +53,4 @@ class DummyFile:
5853
pass
5954

6055
size = get_file_size(DummyFile())
61-
assert size is None
56+
assert size is None

tests/unit/test_http_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Unit tests for HTTPClient."""
22

3-
import pytest
43

5-
from nutrient_dws.exceptions import APIError, AuthenticationError, NutrientTimeoutError
64
from nutrient_dws.http_client import HTTPClient
75

86

@@ -36,4 +34,4 @@ def test_http_client_context_manager():
3634
"""Test HTTP client can be used as context manager."""
3735
with HTTPClient(api_key="test-key") as client:
3836
assert client is not None
39-
assert hasattr(client, "_session")
37+
assert hasattr(client, "_session")

0 commit comments

Comments
 (0)