Files
operating-room-monitor-server/backend/tests/test_baidu_unified_env.py
Kevin 1af442481e 重组为 backend/clients/docs 三层结构,并清理 git 污染。
将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:02:25 +08:00

21 lines
614 B
Python

"""百度凭据:仅从环境变量 BAIDU_APP_ID / BAIDU_API_KEY / BAIDU_SECRET_KEY 读入。"""
import os
from unittest.mock import patch
from app.config import Settings
def test_speech_creds_from_baidu_env_triplet() -> None:
extra = {
"BAIDU_APP_ID": "app-x",
"BAIDU_API_KEY": "key-x",
"BAIDU_SECRET_KEY": "sec-x",
}
with patch.dict(os.environ, extra, clear=False):
s = Settings()
assert s.baidu_speech_app_id == "app-x"
assert s.baidu_speech_api_key == "key-x"
assert s.baidu_speech_secret_key == "sec-x"
assert s.baidu_speech_configured is True