测试空输入是否被正确处理
()
| 173 | |
| 174 | |
| 175 | def 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 | |
| 184 | def test_prompt_only_spaces(): |
nothing calls this directly
no test coverage detected