MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / test_too_long_input

Function test_too_long_input

tests/ce/server/test_evil_cases.py:166–172  ·  view source on GitHub ↗

测试超长输入是否被正确处理

()

Source from the content-addressed store, hash-verified

164
165
166def 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
175def test_empty_input():

Callers

nothing calls this directly

Calls 3

build_request_payloadFunction · 0.90
send_requestFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected