fix(qqbot): fix test failures after package refactor

- Re-export _ssrf_redirect_guard from __init__.py
- Fix _parse_json @staticmethod using self._log_tag
- Update test_detect_message_type to call as instance method
- Fix mock.patch path for httpx.AsyncClient in adapter submodule
This commit is contained in:
WideLee
2026-04-17 20:42:41 +08:00
committed by Teknium
parent 287d3e12c7
commit 103beea7a6
3 changed files with 6 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ from .adapter import ( # noqa: F401
QQCloseError,
check_qq_requirements,
_coerce_list,
_ssrf_redirect_guard,
)
# -- Onboard (QR-code scan-to-configure) -----------------------------------
@@ -40,6 +41,7 @@ __all__ = [
"QQCloseError",
"check_qq_requirements",
"_coerce_list",
"_ssrf_redirect_guard",
# onboard
"BindStatus",
"create_bind_task",

View File

@@ -766,7 +766,7 @@ class QQAdapter(BasePlatformAdapter):
try:
payload = json.loads(raw)
except Exception:
logger.debug("[%s] Failed to parse JSON: %r", self._log_tag, raw)
logger.warning("[QQBot] Failed to parse JSON: %r", raw)
return None
return payload if isinstance(payload, dict) else None