2023-12-11 21:53:30 +00:00
|
|
|
from langchain_community.document_loaders.github import GitHubIssuesLoader
|
2023-05-30 03:11:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_issues_load() -> None:
|
2024-02-13 02:30:36 +00:00
|
|
|
title = " Add caching to BaseChatModel (issue #1644)"
|
2023-05-30 03:11:21 +00:00
|
|
|
loader = GitHubIssuesLoader(
|
2024-02-13 02:30:36 +00:00
|
|
|
repo="langchain-ai/langchain",
|
|
|
|
creator="UmerHA",
|
|
|
|
state="all",
|
|
|
|
per_page=3,
|
|
|
|
page=2,
|
|
|
|
access_token="""""",
|
2023-05-30 03:11:21 +00:00
|
|
|
)
|
|
|
|
docs = loader.load()
|
|
|
|
titles = [d.metadata["title"] for d in docs]
|
|
|
|
assert title in titles
|
|
|
|
assert all(doc.metadata["creator"] == "UmerHA" for doc in docs)
|
2024-02-13 02:30:36 +00:00
|
|
|
assert len(docs) == 3
|