This commit is contained in:
2026-02-27 16:03:04 +08:00
commit 5aedf1665d
137 changed files with 17604 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
"""健康检查测试"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
def test_set_status():
"""测试状态设置"""
from utils.health_check import set_qingjian_connected, set_wechat_ok
set_qingjian_connected(True)
set_qingjian_connected(False)
set_wechat_ok(True)
print("health check status OK")
async def test_run_check():
"""测试执行健康检查(不实际发告警)"""
from utils.health_check import run_health_check
await run_health_check(lambda: True)
print("health check run OK")
if __name__ == "__main__":
import asyncio
test_set_status()
asyncio.run(test_run_check())
print("All health check tests passed")