# -*- coding: utf-8 -*- """票 04:e2e 回归报告整理——本次 F11/F12 结果另存为回归证据,恢复原始报告文件名。""" import io, sys, shutil, os sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') d = r'e:\code\crm-backend-matt\.scratch\opportunity-e2e' for name in ('report-core.md', 'e2e-core-result.json'): cur = os.path.join(d, name) bak = os.path.join(d, name + '.bak-pre-t04') reg = os.path.join(d, name.replace('.', '-t04-regression.').replace('-t04-regression-', '-t04-regression.')) # report-core.md -> report-core-t04-regression.md ; e2e-core-result.json -> e2e-core-result-t04-regression.json reg = os.path.join(d, name.replace('.md', '-t04-regression.md').replace('.json', '-t04-regression.json')) if os.path.exists(cur): shutil.copy2(cur, reg) print(f'saved regression copy: {name} -> {os.path.basename(reg)}') if os.path.exists(bak): shutil.copy2(bak, cur) print(f'restored original: {os.path.basename(bak)} -> {name}')