Skip to content

Commit 9df70e4

Browse files
author
zhangtao
committed
test: 补充传输服务临时文件清理
1 parent 1540931 commit 9df70e4

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎backend/tests/test_transfer_engine_helpers.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ def test_transfer_steps_parallel_and_chain() -> None:
6969
steps2 = StorageTransferService._build_steps(data2)
7070
assert steps2[0].source_id == 1 and steps2[0].source_path == "a"
7171
assert steps2[1].source_id == 2 and steps2[1].source_path == "b"
72+
73+
74+
def test_transfer_service_remove_local_temp(tmp_path: Path) -> None:
75+
from app.modules.task.storage.transfer.service import StorageTransferService
76+
f = tmp_path / "tmp.txt"
77+
f.write_text("x")
78+
StorageTransferService._remove_local_temp(SimpleNamespace(source_type="local", source_path=str(f)))
79+
assert not f.exists()
80+
StorageTransferService._remove_local_temp(SimpleNamespace(source_type="remote", source_path=str(f)))
81+
StorageTransferService._remove_local_temp(SimpleNamespace(source_type="local", source_path=str(f)))

‎docs/COVERAGE-PLAN.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ D 包含四个独立目标:
3535
- `test_workflow_graph_service.py`:画布拆分、去重、源目标派生、非法连线,workflow service 39%;
3636
- `test_online_service.py`:在线列表/搜索/清理/趋势,online service 81%;修复搜索参数把 str 当 tuple、趋势少算今天的问题;
3737
- 监控服务补充本地 IP 成功/降级、Python 进程信息、汇总调用,server/cache service 均 100%;
38-
- online service 补充 dashboard 统计、空 token/缺失会话处理,98%。
38+
- online service 补充 dashboard 统计、空 token/缺失会话处理,98%;
39+
- transfer service 补充本地临时文件清理。
3940

4041
## 外部协议范围(2026-11-05 确认)
4142

0 commit comments

Comments
 (0)