feature/crawler #14

Merged
ccyj merged 10 commits from feature/crawler into main 2024-05-11 20:49:01 +08:00
Showing only changes of commit e80838836c - Show all commits

View File

@@ -21,7 +21,7 @@ class TestWebScrapingAndReporting(unittest.TestCase):
def test_fetch_html_failure(self):
"""测试fetch_html在请求失败时返回None。"""
with patch("requests.get") as mocked_get:
mocked_get.return_code.status_code = 404
mocked_get.return_value.status_code = 404
url = "http://example.com"
result = fetch_html(url)
self.assertIsNone(result)