Skip to content

Commit

Permalink
Make a failing test if metadata list and directory
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-science committed Feb 4, 2024
1 parent e2b3852 commit 1c4802e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion integrations/unstructured/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,22 @@ def test_run_one_doc_per_element_with_meta_list_two_files(self, samples_path):
assert doc.meta["common_meta"] == "common"

@pytest.mark.integration
def test_run_one_doc_per_element_with_meta_list_folder(self, samples_path):
def test_run_one_doc_per_element_with_meta_list_folder_fail(self, samples_path):
pdf_path = [samples_path]
meta = [{"custom_meta": "foobar", "common_meta": "common"}, {"other_meta": "barfoo", "common_meta": "common"}]
local_converter = UnstructuredFileConverter(
api_url="http://localhost:8000/general/v0/general", document_creation_mode="one-doc-per-element"
)
with pytest.raises(ValueError):
local_converter.run(paths=pdf_path, meta=meta)["documents"]

@pytest.mark.integration
def test_run_one_doc_per_element_with_meta_list_folder(self, samples_path):
pdf_path = [samples_path]
meta = {"common_meta": "common"}
local_converter = UnstructuredFileConverter(
api_url="http://localhost:8000/general/v0/general", document_creation_mode="one-doc-per-element"
)

documents = local_converter.run(paths=pdf_path, meta=meta)["documents"]

Expand Down

0 comments on commit 1c4802e

Please sign in to comment.