Add support for GH prs as well

This commit is contained in:
gagb
2024-12-13 14:57:39 -08:00
parent 0b6554738c
commit 8a30fca732
2 changed files with 79 additions and 12 deletions

View File

@@ -88,6 +88,7 @@ SERP_TEST_EXCLUDES = [
]
GITHUB_ISSUE_URL = "https://github.com/microsoft/autogen/issues/1421"
GITHUB_PR_URL = "https://github.com/microsoft/autogen/pull/194"
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN", "")
@@ -195,9 +196,21 @@ def test_markitdown_github_issue() -> None:
assert "Comments:" in result.text_content
@pytest.mark.skipif(
not GITHUB_TOKEN,
reason="GitHub token not provided",
)
def test_markitdown_github_pr() -> None:
markitdown = MarkItDown()
result = markitdown.convert(GITHUB_PR_URL, github_token=GITHUB_TOKEN)
print(result.text_content)
assert "faq" in result.text_content
if __name__ == "__main__":
"""Runs this file's tests from the command line."""
test_markitdown_remote()
test_markitdown_local()
test_markitdown_exiftool()
test_markitdown_github_issue()
test_markitdown_github_pr()