[Test] add unit tests for web_reader_tool.py (#24309)

Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Yongtao Huang
2025-08-22 09:28:00 +08:00
committed by GitHub
parent 21c56c3107
commit 6b466a8469
2 changed files with 290 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ def get_url(url: str, user_agent: Optional[str] = None) -> str:
else:
content = response.text
article = extract_using_readability(content)
article = extract_using_readabilipy(content)
if not article.text:
return ""
@@ -101,7 +101,7 @@ class Article:
text: Sequence[dict]
def extract_using_readability(html: str):
def extract_using_readabilipy(html: str):
json_article: dict[str, Any] = simple_json_from_html_string(html, use_readability=True)
article = Article(
title=json_article.get("title") or "",