fix: 补充 __init__.py 导出符号,修复测试导入错误
- src/core/extraction/__init__.py: 导出 _image_to_base64 - src/core/matching/__init__.py: 导出所有内部函数(_build_invoice_summary, _build_payment_records, _invoices_to_records, _match, _match_by_filename, _match_one_to_many, _match_one_to_one, _relative_tolerance, _safe_float) - src/infra/documents/__init__.py: 导出 INVOICE_LEVEL_COLUMNS, PAYMENT_RECORD_COLUMNS - tests/test_extractor.py: 修正 monkeypatch 路径为模块级引用
This commit is contained in:
@@ -129,7 +129,7 @@ class TestExtractInvoices:
|
||||
}
|
||||
]
|
||||
|
||||
monkeypatch.setattr("src.core.matching.matcher.match_invoices_to_cards", fake_match)
|
||||
monkeypatch.setattr("src.core.extraction.extractor.match_invoices_to_cards", fake_match)
|
||||
|
||||
records, apps, groups = extract_invoices(str(tmp_path))
|
||||
|
||||
@@ -194,7 +194,7 @@ class TestExtractInvoices:
|
||||
},
|
||||
]
|
||||
|
||||
monkeypatch.setattr("src.core.matching.matcher.match_invoices_to_cards", fake_match)
|
||||
monkeypatch.setattr("src.core.extraction.extractor.match_invoices_to_cards", fake_match)
|
||||
|
||||
records, apps, groups = extract_invoices(str(tmp_path))
|
||||
|
||||
@@ -241,7 +241,7 @@ class TestExtractInvoices:
|
||||
}
|
||||
]
|
||||
|
||||
monkeypatch.setattr("src.core.matching.matcher.match_invoices_to_cards", fake_match)
|
||||
monkeypatch.setattr("src.core.extraction.extractor.match_invoices_to_cards", fake_match)
|
||||
|
||||
records, apps, groups = extract_invoices(str(tmp_path))
|
||||
|
||||
@@ -283,7 +283,7 @@ class TestExtractInvoices:
|
||||
}
|
||||
]
|
||||
|
||||
monkeypatch.setattr("src.core.matching.matcher.match_invoices_to_cards", fake_match)
|
||||
monkeypatch.setattr("src.core.extraction.extractor.match_invoices_to_cards", fake_match)
|
||||
|
||||
records, apps, groups = extract_invoices(str(tmp_path))
|
||||
|
||||
@@ -324,7 +324,7 @@ class TestExtractInvoices:
|
||||
}
|
||||
]
|
||||
|
||||
monkeypatch.setattr("src.core.matching.matcher.match_invoices_to_cards", fake_match)
|
||||
monkeypatch.setattr("src.core.extraction.extractor.match_invoices_to_cards", fake_match)
|
||||
|
||||
records, apps, groups = extract_invoices(str(tmp_path))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user