feat(server): GET /api/sessions 支持 project 查询参数
This commit is contained in:
@@ -347,3 +347,12 @@ def test_generate_with_project_config_no_template_upload(client):
|
||||
gen = client.post(f"/api/sessions/{sid}/generate", json={})
|
||||
assert gen.status_code == 200, gen.text
|
||||
assert client.get(f"/api/sessions/{sid}/result/download").status_code == 200
|
||||
|
||||
def test_api_list_sessions_filter_by_project(client):
|
||||
r0 = client.post("/api/sessions", json={"user_id": "u1", "project": "stock"})
|
||||
r1 = client.post("/api/sessions", json={"user_id": "u1", "project": "other"})
|
||||
res = client.get("/api/sessions", params={"user_id": "u1", "project": "stock"})
|
||||
assert res.status_code == 200
|
||||
ids = {x["session_id"] for x in res.json()}
|
||||
assert r0.json()["session_id"] in ids
|
||||
assert r1.json()["session_id"] not in ids
|
||||
|
||||
Reference in New Issue
Block a user