fix: fix return value
Some checks are pending
Python application test / build (pull_request) Waiting to run
Some checks are pending
Python application test / build (pull_request) Waiting to run
This commit is contained in:
parent
bfacbb757c
commit
e80838836c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user