6b7e6b44f1
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
gh-pages / build (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
27 lines
987 B
Python
27 lines
987 B
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
from graphrag_input import InputConfig, InputType, create_input_reader
|
|
from graphrag_storage import StorageConfig, create_storage
|
|
|
|
|
|
# these tests just confirm we can load files with MarkItDown,
|
|
# and use html specifically because it requires no additional dependency installation
|
|
async def test_markitdown_loader_one_file():
|
|
config = InputConfig(
|
|
type=InputType.MarkItDown,
|
|
file_pattern=".*\\.html$",
|
|
)
|
|
storage = create_storage(
|
|
StorageConfig(
|
|
base_dir="tests/unit/indexing/input/data/one-html",
|
|
)
|
|
)
|
|
reader = create_input_reader(config, storage)
|
|
documents = await reader.read_files()
|
|
assert len(documents) == 1
|
|
# markitdown will extract the title and body from the HTML if present and clean them
|
|
assert documents[0].title == "Test"
|
|
assert documents[0].text == "Hi how are you today?"
|
|
assert documents[0].raw_data is None
|