fix(regulatory): 修复换行产品名称提取不全
This commit is contained in:
@@ -14,6 +14,21 @@ def test_extract_text_reads_plain_text(tmp_path):
|
||||
assert result.content_hash
|
||||
|
||||
|
||||
def test_extract_text_keeps_wrapped_product_name(tmp_path):
|
||||
path = tmp_path / "申请表.txt"
|
||||
path.write_text(
|
||||
"产品名称:呼吸道合胞病毒、肺炎支原体核酸检测试剂盒\n"
|
||||
"(荧光PCR法)\n"
|
||||
"型号规格:24人份/盒\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = extract_text(path)
|
||||
|
||||
assert result.field_candidates["产品名称"] == "呼吸道合胞病毒、肺炎支原体核酸检测试剂盒 (荧光PCR法)"
|
||||
assert result.field_candidates["型号规格"] == "24人份/盒"
|
||||
|
||||
|
||||
def test_extract_text_reports_unsupported_file(tmp_path):
|
||||
path = tmp_path / "image.png"
|
||||
path.write_bytes(b"png")
|
||||
|
||||
Reference in New Issue
Block a user