文件夹整理
This commit is contained in:
53
doc/test-data/test-scripts/generate_test_data.py
Normal file
53
doc/test-data/test-scripts/generate_test_data.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
测试数据生成预览工具
|
||||
|
||||
用于预览测试数据,无需运行完整测试
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 添加项目根目录到路径
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
|
||||
from doc.test_scripts.test_import_duplicate_detection import ExcelGenerator
|
||||
|
||||
def main():
|
||||
print("=" * 80)
|
||||
print("测试数据生成预览")
|
||||
print("=" * 80)
|
||||
|
||||
print("\n[1/4] 生成采购交易重复数据...")
|
||||
file1 = ExcelGenerator.create_purchase_duplicate_data()
|
||||
print(f"✓ 文件已生成: {file1}")
|
||||
print(" 包含3条采购事项ID相同的记录(PURCHASE001)")
|
||||
|
||||
print("\n[2/4] 生成员工柜员号重复数据...")
|
||||
file2 = ExcelGenerator.create_employee_employee_id_duplicate()
|
||||
print(f"✓ 文件已生成: {file2}")
|
||||
print(" 包含3条柜员号相同的记录(10001)")
|
||||
|
||||
print("\n[3/4] 生成员工身份证号重复数据...")
|
||||
file3 = ExcelGenerator.create_employee_id_card_duplicate()
|
||||
print(f"✓ 文件已生成: {file3}")
|
||||
print(" 包含3条身份证号相同的记录(110101199001011234)")
|
||||
|
||||
print("\n[4/4] 生成混合重复数据...")
|
||||
file4, file5 = ExcelGenerator.create_mixed_duplicate_scenario()
|
||||
print(f"✓ 文件已生成: {file4}")
|
||||
print(f"✓ 文件已生成: {file5}")
|
||||
print(" 包含数据库重复+Excel内重复的混合场景")
|
||||
|
||||
print("\n" + "=" * 80)
|
||||
print("所有测试数据已生成完成!")
|
||||
print("=" * 80)
|
||||
print("\n数据保存位置: doc/test-data/temp/")
|
||||
print("\n可以使用以下方式导入测试:")
|
||||
print("1. 通过前端界面上传")
|
||||
print("2. 运行完整测试: python doc/test-scripts/test_import_duplicate_detection.py")
|
||||
print("=" * 80)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user