mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
a0cd6672aa
Co-authored-by: Tim Asp <707699+timothyasp@users.noreply.github.com>
21 lines
639 B
Python
21 lines
639 B
Python
from langchain.document_loaders import SitemapLoader
|
|
|
|
|
|
def test_sitemap() -> None:
|
|
"""Test sitemap loader."""
|
|
loader = SitemapLoader("https://langchain.readthedocs.io/sitemap.xml")
|
|
documents = loader.load()
|
|
assert len(documents) > 1
|
|
assert "🦜🔗" in documents[0].page_content
|
|
|
|
|
|
def test_filter_sitemap() -> None:
|
|
"""Test sitemap loader."""
|
|
loader = SitemapLoader(
|
|
"https://langchain.readthedocs.io/sitemap.xml",
|
|
filter_urls=["https://langchain.readthedocs.io/en/stable/"],
|
|
)
|
|
documents = loader.load()
|
|
assert len(documents) == 1
|
|
assert "🦜🔗" in documents[0].page_content
|