Skip to content

Commit d276d6e

Browse files
committed
Merge remote-tracking branch 'origin/pprados/fix_password' into pprados/fix_password
# Conflicts: # test_unstructured_inference/inference/test_layout.py # unstructured_inference/inference/layout.py
2 parents c3ca1dd + ecc95eb commit d276d6e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test_unstructured_inference/inference/test_layout.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,22 @@ 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("sample-docs/password.pdf", password="password")
308+
doc = layout.DocumentLayout.from_file(
309+
"sample-docs/password.pdf",
310+
password="password")
309311
assert doc
310312

311-
monkeypatch.setattr(layout, "get_model", lambda x: MockLayoutModel(mock_final_layout))
313+
monkeypatch.setattr(layout, "get_model",
314+
lambda x: MockLayoutModel(mock_final_layout))
312315
with patch(
313316
"unstructured_inference.inference.layout.UnstructuredObjectDetectionModel",
314317
MockLayoutModel,
315-
), open("sample-docs/password.pdf", mode="rb") as fp:
318+
), open("sample-docs/password.pdf",mode="rb") as fp:
316319
doc = layout.process_data_with_model(fp, model_name="fake", password="password")
317320
assert doc
318321

319322

323+
320324
def test_from_image_file_raises_with_empty_fn():
321325
with pytest.raises(FileNotFoundError):
322326
layout.DocumentLayout.from_image_file("")

0 commit comments

Comments
 (0)