2024-10-19 17:25:56 +08:00
|
|
|
import json
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-12-06 14:40:22 +08:00
|
|
|
from flask_app.工程标.资格评审 import process_qualification
|
2024-10-19 15:33:55 +08:00
|
|
|
|
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
def test_process_qualification_type1():
|
|
|
|
# Test inputs
|
|
|
|
qualification_review = {} # Empty dict
|
|
|
|
# output_folder = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test"
|
|
|
|
truncate3 = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_qualification.pdf"
|
|
|
|
invalid_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_invalid.pdf" # Not used in this case
|
|
|
|
merged_baseinfo_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_merged_baseinfo.pdf"
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Call the function
|
|
|
|
res = process_qualification(qualification_review, truncate3, invalid_path, merged_baseinfo_path)
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Print the output
|
|
|
|
print("Test Case 1 - Type1 Output:")
|
|
|
|
print(json.dumps(res, ensure_ascii=False, indent=4))
|
|
|
|
# Execute the test
|
|
|
|
# test_process_qualification_type1()
|
|
|
|
def test_process_qualification_type2():
|
|
|
|
# Test inputs
|
|
|
|
qualification_review = {} # Empty dict
|
|
|
|
truncate3 = ""
|
|
|
|
invalid_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_invalid.pdf"
|
|
|
|
merged_baseinfo_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_merged_baseinfo.pdf"
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Call the function
|
|
|
|
res = process_qualification(qualification_review, truncate3, invalid_path, merged_baseinfo_path)
|
|
|
|
# Print the output
|
|
|
|
print("Test Case 2 - Type2 Output:")
|
|
|
|
print(json.dumps(res, ensure_ascii=False, indent=4))
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Execute the test
|
|
|
|
# test_process_qualification_type2()
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
def test_process_qualification_type3():
|
|
|
|
# Test inputs
|
|
|
|
qualification_review = {
|
|
|
|
'营业执照': '具备有效的营业执照',
|
|
|
|
'不存在禁止投标的': '不存在第二章“投标人须知”第 1.4.3 项规定的情形'
|
|
|
|
}
|
|
|
|
truncate3 = "" # No qualification attachment
|
|
|
|
invalid_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_invalid.pdf" # Not used in this case
|
|
|
|
merged_baseinfo_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_merged_baseinfo.pdf"
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Call the function
|
|
|
|
res = process_qualification(qualification_review, truncate3, invalid_path, merged_baseinfo_path)
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
# Print the output
|
|
|
|
print("Test Case 3 - Type3 Output:")
|
|
|
|
print(json.dumps(res, ensure_ascii=False, indent=4))
|
2024-10-19 15:33:55 +08:00
|
|
|
|
2024-10-19 17:25:56 +08:00
|
|
|
|
|
|
|
# Execute the test
|
|
|
|
# test_process_qualification_type3()
|
|
|
|
|
|
|
|
def test_process_qualification_type4():
|
|
|
|
# Test inputs
|
|
|
|
qualification_review = {
|
|
|
|
'资质条件': '符合相关资质要求',
|
2024-10-21 17:31:48 +08:00
|
|
|
'财务状况': '符合财务健康标准',
|
|
|
|
'联合体投标人(如有)':'xxxxx',
|
|
|
|
'分包':'符合附件规定'
|
2024-10-19 17:25:56 +08:00
|
|
|
}
|
|
|
|
truncate3 = "" # Missing qualification attachment
|
|
|
|
invalid_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_invalid.pdf" # Not used in this case
|
|
|
|
merged_baseinfo_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_merged_baseinfo.pdf"
|
|
|
|
|
|
|
|
# Call the function
|
|
|
|
res = process_qualification(qualification_review, truncate3, invalid_path, merged_baseinfo_path)
|
|
|
|
|
|
|
|
# Print the output
|
|
|
|
print("Test Case 4 - Type4 Output:")
|
|
|
|
print(json.dumps(res, ensure_ascii=False, indent=4))
|
|
|
|
|
|
|
|
|
|
|
|
# Execute the test
|
2024-10-21 17:31:48 +08:00
|
|
|
# test_process_qualification_type4()
|
|
|
|
|
|
|
|
|
|
|
|
def test_process_qualification_type5():
|
|
|
|
# Test inputs
|
|
|
|
qualification_review = {
|
|
|
|
'资质条件': '符合相关资质要求',
|
|
|
|
'财务状况': '符合财务健康标准',
|
|
|
|
'营业执照': '具备有效的营业执照'
|
|
|
|
}
|
|
|
|
truncate3 = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_qualification.pdf" # Qualification attachment provided
|
|
|
|
invalid_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_invalid.pdf"
|
|
|
|
merged_baseinfo_path = "C:\\Users\\Administrator\\Desktop\\招标文件\\new_test\\zbtest2_merged_baseinfo.pdf"
|
|
|
|
|
|
|
|
# Call the function
|
|
|
|
res = process_qualification(qualification_review, truncate3, invalid_path, merged_baseinfo_path)
|
|
|
|
|
|
|
|
# Print the output
|
|
|
|
print("Test Case 5 - Type5 Output:")
|
|
|
|
print(json.dumps(res, ensure_ascii=False, indent=4))
|
|
|
|
|
|
|
|
|
|
|
|
# Execute the test
|
|
|
|
test_process_qualification_type5()
|