()
| 9 | |
| 10 | |
| 11 | def test_markitdown_xls_parser(): |
| 12 | current_dir = os.path.dirname(os.path.abspath(__file__)) |
| 13 | tests_root = os.path.abspath(os.path.join(current_dir, "..")) |
| 14 | |
| 15 | path1 = os.path.join(tests_root, "main", "data", "sample.xlsx") |
| 16 | |
| 17 | # Test XLS parsing |
| 18 | xls_parser = DocumentParser.create( |
| 19 | path1, |
| 20 | ParsingConfig( |
| 21 | n_neighbor_ids=2, |
| 22 | xls=MarkitdownXLSParsingConfig(), |
| 23 | ), |
| 24 | ) |
| 25 | doc_xls = xls_parser.get_doc() |
| 26 | assert isinstance(doc_xls.content, str) |
| 27 | assert len(doc_xls.content) > 0 |
| 28 | assert doc_xls.metadata.source == path1 |
| 29 | |
| 30 | xls_chunks = xls_parser.get_doc_chunks() |
| 31 | assert len(xls_chunks) > 0 |
| 32 | assert all(chunk.metadata.is_chunk for chunk in xls_chunks) |
| 33 | assert all(path1 in chunk.metadata.source for chunk in xls_chunks) |
| 34 | |
| 35 | |
| 36 | def test_markitdown_pptx_parser(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…