feat(test): add fake platform factory

Add tests/factories/platform.py with:
- FakePlatform: simulated platform adapter
- Inbound message construction: friend/group/image
- Mention-bot flag simulation
- Outbound message capture for assertions
- Streaming output support simulation
- Send failure simulation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
huanghuoguoguo
2026-05-08 13:57:04 +08:00
parent 27227aa31f
commit 77be87ed40
2 changed files with 350 additions and 0 deletions
+13
View File
@@ -39,6 +39,13 @@ from tests.factories.provider import (
fake_provider_malformed,
fake_model,
)
from tests.factories.platform import (
FakePlatform,
fake_platform,
fake_platform_with_streaming,
fake_platform_with_failure,
mock_platform_adapter,
)
__all__ = [
# App
@@ -66,4 +73,10 @@ __all__ = [
"fake_provider_rate_limit",
"fake_provider_malformed",
"fake_model",
# Platform
"FakePlatform",
"fake_platform",
"fake_platform_with_streaming",
"fake_platform_with_failure",
"mock_platform_adapter",
]