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

Function test_empty_input

tests/ce/server/test_evil_cases.py:175–181  ·  view source on GitHub ↗

测试空输入是否被正确处理

()

Source from the content-addressed store, hash-verified

173
174
175def test_empty_input():
176 """测试空输入是否被正确处理"""
177 data = {"messages": [{"role": "user", "content": ""}], "stream": False} # 空输入
178 payload = build_request_payload(TEMPLATE, data)
179 resp = send_request(URL, payload).json()
180 assert "error" not in resp.get("object"), "空输入被识别为错误"
181 assert len(resp["choices"][0]["message"]["content"]) > 0, "内容为空时,回复为空"
182
183
184def test_prompt_only_spaces():

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