feat: support item value policies and migrated multi-file BOM import
Core regression / Python core and release configuration (push) Successful in 17s
Core regression / JavaScript syntax (push) Successful in 2s
Core regression / Python core and release configuration (pull_request) Successful in 14s
Core regression / JavaScript syntax (pull_request) Successful in 3s

This commit is contained in:
阿白叔 committed 2026-11-05 11:26:35 +08:00
1 parent 9316cf4fc4
commit 8b5509d64f
29 files changed
+1418 -63

No files matched your search

+38
View File
@@ -68,3 +68,41 @@ def test_native_short_path_never_passes_extended_prefix_to_wsh(tmp_path):
if result is None:
pytest.skip('filesystem does not provide short paths')
assert not result.startswith(chr(92) * 2 + '?')
def test_batch_resource_record_retries_reader_denied_atomic_replace(tmp_path, monkeypatch):
import json
import os
from threading import Timer
if os.name != 'nt':
pytest.skip('Windows delete-sharing boundary')
import win32con
import win32file
from dx_productivity.trial_task_center import batch_resources
path = tmp_path / 'session.json'
path.write_text('{"stage": "before"}', encoding='utf-8')
reader = win32file.CreateFile(str(path), win32con.GENERIC_READ,
win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE, None,
win32con.OPEN_EXISTING, 0, None)
real_replace = os.replace
denials, timers = [], []
def replace(source, target):
try:
return real_replace(source, target)
except PermissionError as error:
denials.append(error.winerror)
timer = Timer(.02, reader.Close)
timers.append(timer)
timer.start()
raise
monkeypatch.setattr(batch_resources.os, 'replace', replace)
try:
batch_resources.write_record(path, {'stage': 'saved'})
assert denials == [5]
assert json.loads(path.read_text(encoding='utf-8')) == {'stage': 'saved'}
assert not list(tmp_path.glob('*.tmp'))
finally:
for timer in timers:
timer.join()
reader.Close()