Skip to content

Commit 060acdd

Browse files
authored
Jj/fix tests2 (#13)
1 parent a3429c3 commit 060acdd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

libs/unstructured/tests/integration_tests/test_document_loaders.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,16 @@ def test_loader_partitions_multiple_via_api() -> None:
193193
assert docs[-1].metadata.get("filename") == "fake-email-attachment.eml"
194194

195195

196-
def test_loader_partition_via_api_raises_TypeError_with_invalid_arg() -> None:
197-
file_path = os.path.join(EXAMPLE_DOCS_DIRECTORY, "layout-parser-paper.pdf")
196+
def test_loader_partition_via_api_ignores_invalid_arg() -> None:
197+
file_path = os.path.join(EXAMPLE_DOCS_DIRECTORY, "fake-email-attachment.eml")
198198
loader = UnstructuredLoader(
199199
file_path=file_path,
200200
api_key=UNSTRUCTURED_API_KEY,
201201
partition_via_api=True,
202-
mode="elements",
202+
mode="elements", # mode is no longer a valid argument and is ignored
203203
)
204204

205-
with pytest.raises(TypeError):
206-
loader.load()
205+
loader.load()
207206

208207

209208
def test_loader_partitions_via_api_hi_res() -> None:
@@ -217,7 +216,7 @@ def test_loader_partitions_via_api_hi_res() -> None:
217216

218217
docs = loader.load()
219218

220-
categories = set(doc.metadata.get("category") for doc in docs)
219+
categories: set[str] = set(doc.metadata.get("category") for doc in docs)
221220
assert "Table" in categories
222221
assert "Image" in categories
223222

0 commit comments

Comments
 (0)