Refine job estimates, mount cleanup and NTFS identification tests

这个提交包含在:
mac 于 2026-11-11 23:11:00 +08:00 提交
1 父节点 58769c431f
当前提交 12df14ebf0
4 个文件已更改
+42 -5

没有与搜索条件相匹配的文件

+17
查看文件
@@ -6,6 +6,7 @@ import socket
import tempfile
import threading
import unittest
from unittest.mock import patch
ROOT = Path(__file__).resolve().parents[1]
@@ -39,6 +40,22 @@ class PathBoundaryTests(unittest.TestCase):
with self.assertRaises(ValueError):
broker.dispatch({'uid': 0, 'action': 'start', 'args': {}})
def test_usb_apfs_ntfs_identified_and_internal_disks_excluded(self):
broker = module('broker')
tree = {'blockdevices': [
{'tran': 'usb', 'size': 1000, 'serial': 'usb1', 'model': 'Test', 'children': [
{'path': '/dev/test1', 'size': 900, 'fstype': 'ntfs', 'partuuid': 'abc', 'mountpoints': []},
{'path': '/dev/test2', 'size': 100, 'fstype': 'apfs', 'partuuid': 'def', 'mountpoints': []}]},
{'tran': 'sata', 'size': 1000, 'serial': 'system', 'fstype': 'ntfs'}]}
with patch.object(broker, 'command', return_value=json.dumps(tree)):
detected = broker.disks()
self.assertEqual([item['filesystem'] for item in detected], ['ntfs', 'apfs'])
def test_root_listing_uses_empty_relative_path(self):
broker = module('broker')
with tempfile.TemporaryDirectory() as folder:
self.assertEqual(broker.listing(Path(folder))['path'], '')
class GatewayTests(unittest.TestCase):
@classmethod