修复项目主要错误

This commit is contained in:
Falck
2026-05-04 21:19:34 +08:00
parent ba58b3939a
commit 4441a968db
20 changed files with 639 additions and 317 deletions

View File

@@ -65,8 +65,10 @@ class TestConfig:
try:
config = Config()
# 非数字字符串无法转换为 int保留默认值
assert config.get("HTTP_API_PORT") == 8080
assert config.get("PERMISSION_CHECK") is True
# 非布尔值字符串转换为 False仅 'true'/'1'/'yes' 为 True
assert config.get("PERMISSION_CHECK") is False
finally:
for key in ["HTTP_API_PORT", "PERMISSION_CHECK"]:
if key in os.environ:
@@ -89,7 +91,7 @@ class TestConfig:
assert isinstance(config.permission_check, bool)
assert config.http_api_port == 8080
assert config.http_tcp_port == 8082
assert config.host == "0.0.0.0"
assert config.host == "127.0.0.1"
assert config.data_dir == Path("./data")
assert config.store_dir == Path("./store")
assert config.log_level == "INFO"