gengx
This commit is contained in:
@@ -46,7 +46,7 @@ class ManualAIIsolationTest(unittest.TestCase):
|
||||
response = mock.Mock(status_code=200)
|
||||
with (
|
||||
mock.patch(
|
||||
"ai_chat.requests.post",
|
||||
"ai_chat._SESSION.post",
|
||||
side_effect=[requests.exceptions.Timeout(), response],
|
||||
) as post,
|
||||
mock.patch("ai_chat.time.sleep"),
|
||||
@@ -61,7 +61,7 @@ class ManualAIIsolationTest(unittest.TestCase):
|
||||
|
||||
def test_authentication_failure_is_not_retried(self) -> None:
|
||||
response = mock.Mock(status_code=401)
|
||||
with mock.patch("ai_chat.requests.post", return_value=response) as post:
|
||||
with mock.patch("ai_chat._SESSION.post", return_value=response) as post:
|
||||
result = _post_with_retry(
|
||||
"https://example.invalid/v1/chat/completions",
|
||||
purpose="测试模型",
|
||||
|
||||
Reference in New Issue
Block a user