# LSFX Mock Server 异常账户基线同步后端验证记录

## 1. 验证命令

本次按实施过程实际执行了以下命令：

```bash
cd lsfx-mock-server
python3 -m pytest tests/test_file_service.py -k "abnormal_account_baseline" -v
python3 -m pytest tests/test_abnormal_account_baseline_service.py -v
python3 -m pytest tests/test_statement_service.py::test_get_bank_statement_should_only_use_abnormal_account_numbers_from_file_record -v
python3 -m pytest tests/test_statement_service.py -k "abnormal_account" -v
python3 -m pytest tests/test_abnormal_account_baseline_service.py tests/test_file_service.py tests/test_statement_service.py -k "abnormal_account or abnormal_account_baseline" -v
```

## 2. 验证结果摘要

- `tests/test_file_service.py -k "abnormal_account_baseline" -v`：`2 passed`
- `tests/test_abnormal_account_baseline_service.py -v`：`4 passed`
- `tests/test_statement_service.py::test_get_bank_statement_should_only_use_abnormal_account_numbers_from_file_record -v`：通过
- `tests/test_statement_service.py -k "abnormal_account" -v`：`3 passed`
- 聚合回归：
  - `python3 -m pytest tests/test_abnormal_account_baseline_service.py tests/test_file_service.py tests/test_statement_service.py -k "abnormal_account or abnormal_account_baseline" -v`
  - 结果：`10 passed, 41 deselected`

## 3. 关键通过点

- `FileService` 已在缓存 `logId` 前触发异常账户基线同步
- 基线同步失败时不会把半成品 `logId` 写入内存缓存
- `AbnormalAccountBaselineService` 已覆盖空输入、校验失败、插入、更新四类行为
- `StatementService` 返回的异常账户样本流水账号与 `record.abnormal_accounts` 保持一致

## 4. 进程清理

本轮验证仅执行了 `pytest` 命令，未启动前后端或 Mock 服务长驻进程，因此无需额外清理进程。
