langchain/tests/integration_tests/document_loaders/test_github.py
UmerHA 8259f9b7fa
DocumentLoader for GitHub (#5408)
# Creates GitHubLoader (#5257)

GitHubLoader is a DocumentLoader that loads issues and PRs from GitHub.

Fixes #5257

---------

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
2023-05-29 20:11:21 -07:00

13 lines
413 B
Python

from langchain.document_loaders.github import GitHubIssuesLoader
def test_issues_load() -> None:
title = "DocumentLoader for GitHub"
loader = GitHubIssuesLoader(
repo="hwchase17/langchain", creator="UmerHA", state="all"
)
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)