Coverage for python/lum/clu/processors/tests/test_merge_documents.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2024-11-17 18:41 +0000

1from lum.clu.processors.document import Document as CluDocument 

2from lum.clu.processors.tests.utils import load_test_docs, check_doc_token_alignment 

3import pytest 

4import typing 

5 

6def test_merge_documents_1(): 

7 """Test case 1 for Document.merge_documents()""" 

8 docs: list[CluDocument] = list(load_test_docs(["example-1-part-0.json", "example-1-part-1.json", "example-1-part-2.json"])) 

9 doc = CluDocument.merge_documents(docs) 

10 check_doc_token_alignment(doc) 

11 

12 

13def test_merge_documents_2(): 

14 """Test case 2 for Document.merge_documents()""" 

15 docs: list[CluDocument] = list(load_test_docs([f"example-2-part-{i}.json" for i in range(43)])) 

16 doc = CluDocument.merge_documents(docs) 

17 check_doc_token_alignment(doc)