fix: 修复 OSS 删除与历史筛选
This commit is contained in:
@@ -173,10 +173,11 @@ def test_delete_completed_task_removes_remote_artifacts(client, tmp_config):
|
||||
from backend.database import SessionLocal
|
||||
from backend.models import Task
|
||||
|
||||
oss_url = "https://files.example.com/test/iOS/1_2_0_0_0_main.html"
|
||||
task = Task(
|
||||
id="completed-task", app_id="1", app_name="测试App", build_type="Ad_Hoc",
|
||||
scheme_id="1", scheme_name="readoor31", branch="main", status="completed",
|
||||
oss_url="https://files.example.com/test/iOS/1_2_0_0_0_main.html",
|
||||
oss_url=oss_url,
|
||||
config_json=json.dumps({"APPID": "1", "VERSION": "2.0.0.0", "SOURCE_BRANCH": "main", "BUILD_TYPE": "Ad_Hoc", "OSS_FLODER": "test"}),
|
||||
)
|
||||
db = SessionLocal()
|
||||
@@ -189,6 +190,7 @@ def test_delete_completed_task_removes_remote_artifacts(client, tmp_config):
|
||||
|
||||
assert resp.status_code == 200
|
||||
delete.assert_called_once()
|
||||
assert delete.call_args.args[2] == oss_url
|
||||
assert client.get("/api/tasks/completed-task").status_code == 404
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user