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

Function test_prompt_only_spaces

tests/ce/server/test_evil_cases.py:184–200  ·  view source on GitHub ↗

messages content 为纯空格字符串,服务正常返回

()

Source from the content-addressed store, hash-verified

182
183
184def test_prompt_only_spaces():
185 """messages content 为纯空格字符串,服务正常返回"""
186 data = {
187 "messages": [
188 {
189 "role": "user",
190 "content": " ", # 纯空格
191 }
192 ],
193 "stream": False,
194 "max_tokens": 10,
195 }
196 payload = build_request_payload(TEMPLATE, data)
197 resp = send_request(URL, payload).json()
198 assert resp.get("object") == "chat.completion", "应返回 chat.completion 对象"
199 response_content = resp["choices"][0]["message"]["content"]
200 assert len(response_content) > 0, "messages content为空,未正常生成回复"
201
202
203def test_illegal_characters():

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