| from pathlib import Path | |
| ROOT=Path(__file__).resolve().parents[1] | |
| def test_version(): | |
| assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.15" | |
| def test_parallel_sse_uses_real_blank_line_separator(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert 'const ps=buf.split("\\n\\n");buf=ps.pop();' in js | |
| assert 'buf.split("\\\\n\\\\n")' not in js | |
| def test_parallel_sse_flushes_final_buffer(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "const handleSseBlock=(raw)=>" in js | |
| assert "buf+=dec.decode();" in js | |
| assert "if(buf.trim())handleSseBlock(buf);" in js | |
| def test_parallel_sse_accepts_payload_variants(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "E.d.answer" in js | |
| assert "E.d.content" in js | |
| assert "E.d.error" in js | |
| def test_final_multitask_render_still_present(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "## 多任务执行结果" in js | |
| assert 'addMessage("assistant",finalAnswer' in js | |