fix: fix return value
Some checks are pending
Python application test / build (pull_request) Waiting to run

This commit is contained in:
sangge-redmi 2024-05-07 16:26:12 +08:00
parent bfacbb757c
commit e80838836c

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)