42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from server import load_config, parse_records
|
|
|
|
|
|
class TestStatusAlias(unittest.TestCase):
|
|
def test_collect_external_bank_maps_to_collect_other_bank(self) -> None:
|
|
config = load_config()
|
|
raw_text = "#接龙\n21、 濂溪揽收外行5.3万存一年"
|
|
|
|
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("status", "")) == "揽收他行"
|
|
for item in records
|
|
)
|
|
)
|
|
|
|
def test_transfer_external_bank_maps_to_transfer_other_bank(self) -> None:
|
|
config = load_config()
|
|
raw_text = "#接龙\n22、 潇水南路挖转外行20万存半年"
|
|
|
|
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("status", "")) == "他行挖转"
|
|
for item in records
|
|
)
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|