mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
18 lines
460 B
Python
18 lines
460 B
Python
|
from pathlib import Path
|
||
|
|
||
|
from langchain.document_loaders.html_bs import BSHTMLLoader
|
||
|
|
||
|
|
||
|
def test_bs_html_loader() -> None:
|
||
|
"""Test unstructured loader."""
|
||
|
file_path = Path(__file__).parent.parent / "examples/example.html"
|
||
|
loader = BSHTMLLoader(str(file_path))
|
||
|
docs = loader.load()
|
||
|
|
||
|
assert len(docs) == 1
|
||
|
|
||
|
metadata = docs[0].metadata
|
||
|
|
||
|
assert metadata["title"] == "Chew dad's slippers"
|
||
|
assert metadata["source"] == str(file_path)
|