refactor(chain): _mixins.py 更名 _transfer.py,统一功能域 mixin 命名

TransferChain 的 7 个功能域 mixin 集合文件按域更名 _transfer.py,
与 _recognition/_messaging/_interaction/_music 的单域命名约定对齐;
同步更新 transfer.py 导入、9 个测试文件 patch 目标与架构文档。
另含 chain 基类导入排序优化与未使用导入清理(copy/datetime 已随
dispatch 方法迁入 _messaging.py)。
This commit is contained in:
jxxghp
2026-08-16 17:25:49 +08:00
parent 5810f6bc2b
commit 3e417c1ac5
13 changed files with 63 additions and 65 deletions
+5 -5
View File
@@ -31,7 +31,7 @@ def test_enabled_cleanup_skips_filesystem_detection():
开关开启时应保持旧行为,且不产生额外文件系统检测。
"""
with patch(
"app.chain._mixins.SystemUtils.is_network_filesystem"
"app.chain._transfer.SystemUtils.is_network_filesystem"
) as is_network_filesystem:
should_delete = (
TransferChain._should_delete_empty_source_directories(
@@ -50,7 +50,7 @@ def test_disabled_cleanup_keeps_mounted_local_source_directories():
开关关闭时应保留网络或 FUSE 挂载的本地源目录。
"""
with patch(
"app.chain._mixins.SystemUtils.is_network_filesystem",
"app.chain._transfer.SystemUtils.is_network_filesystem",
return_value=True,
) as is_network_filesystem:
should_delete = (
@@ -72,7 +72,7 @@ def test_disabled_cleanup_still_deletes_ordinary_local_source_directories():
开关关闭时普通本地文件系统仍应删除空目录。
"""
with patch(
"app.chain._mixins.SystemUtils.is_network_filesystem",
"app.chain._transfer.SystemUtils.is_network_filesystem",
return_value=False,
):
should_delete = (
@@ -91,7 +91,7 @@ def test_disabled_cleanup_does_not_change_remote_storage_cleanup():
开关关闭时非本地存储仍应执行原有空目录清理。
"""
with patch(
"app.chain._mixins.SystemUtils.is_network_filesystem"
"app.chain._transfer.SystemUtils.is_network_filesystem"
) as is_network_filesystem:
should_delete = (
TransferChain._should_delete_empty_source_directories(
@@ -111,7 +111,7 @@ def test_mounted_filesystem_detection_is_cached_by_source_directory():
"""
mounted_filesystem_cache = {}
with patch(
"app.chain._mixins.SystemUtils.is_network_filesystem",
"app.chain._transfer.SystemUtils.is_network_filesystem",
return_value=True,
) as is_network_filesystem:
for _ in range(2):