Skip to content

Commit

Permalink
fixing tests and returning a dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsbatista committed Dec 4, 2024
1 parent 8e62968 commit 12549bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/components/preprocessors/test_recursive_chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_recursive_splitter_empty_documents():
chunker = RecursiveChunker(chunk_size=20, chunk_overlap=0, separators=["."])
empty_doc = Document(content="")
doc_chunks = chunker.run([empty_doc])
doc_chunks = doc_chunks["documents"]
assert len(doc_chunks) == 0


Expand All @@ -110,6 +111,7 @@ def test_recursive_chunker_with_multiple_separators_recursive():

doc = Document(content=text)
doc_chunks = chunker.run([doc])
doc_chunks = doc_chunks["documents"]
assert len(doc_chunks) == 4
assert (
doc_chunks[0].meta["original_id"]
Expand Down Expand Up @@ -137,6 +139,7 @@ def test_recursive_chunker_split_document_with_overlap(chunk_overlap):

doc = Document(content=text)
doc_chunks = chunker.run([doc])
doc_chunks = doc_chunks["documents"]
if chunker.chunk_overlap == 20:
assert len(doc_chunks) == 4
for i, chunk in enumerate(doc_chunks):
Expand Down

0 comments on commit 12549bd

Please sign in to comment.