fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理 (BaseException -> 具体异常类型)
- 修复PEP8格式问题
- 添加类型注解
- 修复tingwu_client.py缩进错误
This commit is contained in:
OpenClaw Bot
2026-02-27 15:20:03 +08:00
parent 96f08b8bb9
commit 646b64daf7
10 changed files with 27 additions and 51 deletions

View File

@@ -94,7 +94,7 @@ def test_domain_management(tenant_id: str):
# 2. 获取验证指导
print("\n2.2 获取域名验证指导...")
instructions = manager.get_domain_verification_instructions(domain.id)
print(f"✅ 验证指导:")
print("✅ 验证指导:")
print(f" - DNS 记录: {instructions['dns_record']}")
print(f" - 文件验证: {instructions['file_verification']}")
@@ -141,7 +141,7 @@ def test_branding_management(tenant_id: str):
custom_js="console.log('Custom JS loaded');",
login_page_bg="https://example.com/bg.jpg"
)
print(f"✅ 品牌配置更新成功")
print("✅ 品牌配置更新成功")
print(f" - Logo: {branding.logo_url}")
print(f" - 主色: {branding.primary_color}")
print(f" - 次色: {branding.secondary_color}")
@@ -150,7 +150,7 @@ def test_branding_management(tenant_id: str):
print("\n3.2 获取品牌配置...")
fetched = manager.get_branding(tenant_id)
assert fetched is not None, "获取品牌配置失败"
print(f"✅ 获取品牌配置成功")
print("✅ 获取品牌配置成功")
# 3. 生成品牌 CSS
print("\n3.3 生成品牌 CSS...")
@@ -246,7 +246,7 @@ def test_usage_tracking(tenant_id: str):
# 2. 获取使用统计
print("\n5.2 获取使用统计...")
stats = manager.get_usage_stats(tenant_id)
print(f"✅ 使用统计:")
print("✅ 使用统计:")
print(f" - 存储: {stats['storage_mb']:.2f} MB")
print(f" - 转录: {stats['transcription_minutes']:.2f} 分钟")
print(f" - API 调用: {stats['api_calls']}")