Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
| from pathlib import Path | |
| ROOT=Path(__file__).resolve().parents[1] | |
| def test_version(): | |
| assert (ROOT/'VERSION').read_text(encoding='utf-8').strip()=='4.6.20' | |
| def test_new_query_slot_reset(): | |
| rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8") | |
| assert "def _is_explicit_new_data_query" in rt | |
| assert "def _reset_optional_slots_for_new_query" in rt | |
| assert 'for key in ("depth","layer","format")' in rt | |
| assert "and (not is_new_query)" in rt | |
| def test_surface_only_preflight(): | |
| rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8") | |
| assert "def _ocean_surface_only_depth_conflict" in rt | |
| assert "OISST / SST 是表层海温产品" in rt | |
| assert "depth_conflict" in rt | |
| def test_multitask_final_render(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "## 多任务执行结果" in js | |
| assert 'addMessage("assistant",finalAnswer' in js | |
| assert "parallel-final" in js | |
| def test_partial_failure_still_finalizes(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "const successCount=results.filter(x=>!x.error).length" in js | |
| assert "const failCount=results.length-successCount" in js | |
| def test_done_payload_fallbacks(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "E.d.answer" in js and "E.d.content" in js | |