feat: initial import (exclude templates and runtime temp files)

This commit is contained in:
237899745
2026-02-27 15:21:15 +08:00
commit 0951732c7a
33 changed files with 11698 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from __future__ import annotations
import unittest
from server import load_config, parse_records
class TestParseAmountSplit(unittest.TestCase):
def test_amount_before_comma_and_term_after_comma(self) -> None:
config = load_config()
raw_text = "#接龙\n11、 四马桥一潘纪君 拜访门窗商户微信提现15万存定期一年"
result = parse_records(raw_text, config, history=[])
records = result.get("new_records", [])
self.assertTrue(
any(
str(item.get("branch", "")) == "四马桥"
and str(item.get("type", "")) == "一年期定期"
and str(item.get("amount", "")) == "15万"
for item in records
)
)
skipped_reasons = [str(x.get("reason", "")) for x in result.get("skipped", [])]
self.assertNotIn("amount_not_found", skipped_reasons)
if __name__ == "__main__":
unittest.main()