完成和大模型的通信
This commit is contained in:
23
tests/test_config.py
Normal file
23
tests/test_config.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""配置加载模块测试。"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
|
||||
|
||||
from config import get_language, load_config
|
||||
|
||||
|
||||
class TestConfig:
|
||||
"""测试配置加载模块。"""
|
||||
|
||||
def test_load_config_returns_dict(self) -> None:
|
||||
"""测试 load_config 返回字典且包含 language 键。"""
|
||||
config = load_config()
|
||||
assert isinstance(config, dict)
|
||||
assert "language" in config
|
||||
|
||||
def test_get_language_from_config(self) -> None:
|
||||
"""测试 get_language 能正常返回语言设置。"""
|
||||
language = get_language()
|
||||
assert language is not None
|
||||
Reference in New Issue
Block a user