feat: 手术视频消耗、待确认与持久化改造
- 新增 Alembic 初始迁移、领域明细模型及归档持久化与重试链路\n- 拆分视频会话注册表、分类处理、推理时间窗聚合与流处理\n- 消耗日志:TSV/Markdown 含 top2/top3;item_id 优先产品编码;待确认记「待确认」行,语音确认后落正式行并更新汇总\n- 待确认时内存/DB 明细为占位行,确认后替换;拒绝时移除占位\n- 分类 probs 先 detach/cpu 再转 NumPy,修复 MPS/CUDA 上推理被静默跳过\n- 补充集成测试、归档与设备张量等单测 Made-with: Cursor
This commit is contained in:
22
tests/test_stream_worker_redaction.py
Normal file
22
tests/test_stream_worker_redaction.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""RTSP URL 日志脱敏。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.services.video.stream_worker import redact_rtsp_url
|
||||
|
||||
|
||||
def test_redact_rtsp_url_with_credentials() -> None:
|
||||
assert (
|
||||
redact_rtsp_url("rtsp://admin:secret@10.0.0.1:554/Streaming/Channels/101")
|
||||
== "rtsp://***@10.0.0.1:554/Streaming/Channels/101"
|
||||
)
|
||||
|
||||
|
||||
def test_redact_rtsp_url_without_credentials_unchanged() -> None:
|
||||
url = "rtsp://10.0.0.1:554/Streaming/Channels/101"
|
||||
assert redact_rtsp_url(url) == url
|
||||
|
||||
|
||||
def test_redact_rtsp_url_empty() -> None:
|
||||
assert redact_rtsp_url(None) == ""
|
||||
assert redact_rtsp_url("") == ""
|
||||
Reference in New Issue
Block a user