File size: 1,167 Bytes
639bbdd
 
 
 
 
c175ac0
639bbdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f9dcec9
639bbdd
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

import pathlib
ROOT=pathlib.Path(__file__).resolve().parents[1]

def test_version_393():
    assert (ROOT/'VERSION').read_text(encoding='utf-8').strip()=='4.6.20'

def test_frontend_lifecycle_progress():
    js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
    for name in ("ensureChatLifecycle","updateChatLifecycle","startChatLifecycleTimer","finishChatLifecycle"):
        assert f"function {name}" in js
    assert "秒没有收到新的服务事件" in js
    assert "1/5 · 解析请求" in js

def test_backend_structured_stage_events():
    rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
    assert '"step":2' in rt
    assert '"step":3' in rt
    assert '"step":4' in rt

def test_download_progress_still_present():
    js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
    assert "function downloadWithProgress" in js
    assert "seconds_since_activity" in js or "秒无新字节" in js

def test_lifecycle_css():
    css=(ROOT/"static"/"css"/"app.css").read_text(encoding="utf-8")
    assert ".chat-task-progress" in css
    assert ".chat-task-progress.stale" in css
    assert ".chat-task-progress.done" in css