Skip to content

Commit 9e32dd6

Browse files
committed
make tidy
1 parent fd35cb3 commit 9e32dd6

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

test_unstructured_inference/inference/test_layout.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,18 @@ def mock_get_elements(self, *args, **kwargs):
305305
@pytest.mark.slow()
306306
def test_from_file_with_password(monkeypatch, mock_final_layout):
307307

308-
doc = layout.DocumentLayout.from_file(
309-
"sample-docs/password.pdf",
310-
password="password")
308+
doc = layout.DocumentLayout.from_file("sample-docs/password.pdf", password="password")
311309
assert doc
312310

313-
monkeypatch.setattr(layout, "get_model",
314-
lambda x: MockLayoutModel(mock_final_layout))
311+
monkeypatch.setattr(layout, "get_model", lambda x: MockLayoutModel(mock_final_layout))
315312
with patch(
316313
"unstructured_inference.inference.layout.UnstructuredObjectDetectionModel",
317314
MockLayoutModel,
318-
), open("sample-docs/password.pdf",mode="rb") as fp:
315+
), open("sample-docs/password.pdf", mode="rb") as fp:
319316
doc = layout.process_data_with_model(fp, model_name="fake", password="password")
320317
assert doc
321318

322319

323-
324320
def test_from_image_file_raises_with_empty_fn():
325321
with pytest.raises(FileNotFoundError):
326322
layout.DocumentLayout.from_image_file("")

unstructured_inference/inference/layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_file(
5151
filename: str,
5252
fixed_layouts: Optional[List[Optional[List[TextRegion]]]] = None,
5353
pdf_image_dpi: int = 200,
54-
password:Optional[str] = None,
54+
password: Optional[str] = None,
5555
**kwargs,
5656
) -> DocumentLayout:
5757
"""Creates a DocumentLayout from a pdf file."""
@@ -135,7 +135,7 @@ def __init__(
135135
document_filename: Optional[Union[str, PurePath]] = None,
136136
detection_model: Optional[UnstructuredObjectDetectionModel] = None,
137137
element_extraction_model: Optional[UnstructuredElementExtractionModel] = None,
138-
password:Optional[str] = None,
138+
password: Optional[str] = None,
139139
):
140140
if detection_model is not None and element_extraction_model is not None:
141141
raise ValueError("Only one of detection_model and extraction_model should be passed.")

0 commit comments

Comments
 (0)