测试超长输入是否被正确处理
()
| 164 | |
| 165 | |
| 166 | def test_too_long_input(): |
| 167 | """测试超长输入是否被正确处理""" |
| 168 | data = {"messages": [{"role": "user", "content": "a," * 200000}], "stream": False} # 超过最大输入长度 |
| 169 | payload = build_request_payload(TEMPLATE, data) |
| 170 | resp = send_request(URL, payload).json() |
| 171 | # assert resp["detail"].get("object") == "error", "超长输入未被识别为错误" |
| 172 | assert "Input text is too long" in resp["error"].get("message", ""), "未检测到最大长度限制错误" |
| 173 | |
| 174 | |
| 175 | def test_empty_input(): |
nothing calls this directly
no test coverage detected