mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix(tests): patch TypingActivityInput after mock on Python <3.12
The SDK requires Python >=3.12 so CI (3.11) falls to the except ImportError branch, leaving TypingActivityInput=None. After loading the adapter module, explicitly restore it from the mock so test_send_typing doesn't silently no-op. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3f023450dd
commit
2333b7a7ec
1 changed files with 7 additions and 0 deletions
|
|
@ -169,6 +169,13 @@ _teams_mod = load_plugin_adapter("teams")
|
|||
_teams_mod.TEAMS_SDK_AVAILABLE = True
|
||||
_teams_mod.AIOHTTP_AVAILABLE = True
|
||||
|
||||
# Ensure SDK symbols that were None (import failed on Python <3.12) are
|
||||
# replaced with the mocked versions so runtime calls don't silently no-op.
|
||||
import sys as _sys
|
||||
_mt = _sys.modules.get("microsoft_teams.api.activities.typing")
|
||||
if _mt and _teams_mod.TypingActivityInput is None:
|
||||
_teams_mod.TypingActivityInput = _mt.TypingActivityInput
|
||||
|
||||
TeamsAdapter = _teams_mod.TeamsAdapter
|
||||
check_requirements = _teams_mod.check_requirements
|
||||
check_teams_requirements = _teams_mod.check_teams_requirements
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue