Files
kefu/deploy/review-visibility-20260916/handoff_safety_tests_patch.py
T
2026-09-21 10:34:06 +08:00

13 lines
918 B
Python

from pathlib import Path
import shutil
for root in (Path('C:/wechat_rpa'),Path('C:/kefu/wechat_rpa')):
path=root/'test_review_handoff.py'
text=path.read_text(encoding='utf-8')
text=text.replace("bot.handoff_pending_replies.assert_called_once_with({'pending-1'})", "bot.handoff_pending_replies.assert_called_once_with({'pending-1'}, confirm_uncertain=False)")
text=text.replace("handoff_pending_reply_file(['unknown', 'sending', 'absent'], str(path))", "handoff_pending_reply_file(['unknown', 'sending', 'absent'], str(path), confirm_uncertain=True)")
text=text.replace("self.bot.handoff_pending_replies([self.key])", "self.bot.handoff_pending_replies([self.key], confirm_uncertain=True)")
path.write_text(text,encoding='utf-8')
shutil.copy2(Path(__file__).with_name('test_handoff_safety.py'),root/'test_handoff_safety.py')
print('Updated explicit-confirmation tests in both directories.')