mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
Create tests/factories/ with reusable test factories: - FakeApp: mock application with all dependencies - Message chains: text_chain, mention_chain, image_chain - Query factories: text_query, group_text_query, command_query, etc. No test changes - maintains backward compatibility. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
48 lines
967 B
Python
48 lines
967 B
Python
"""
|
|
Shared test factories for LangBot tests.
|
|
|
|
Provides reusable factories for:
|
|
- Fake application (app.py)
|
|
- Messages and queries (message.py)
|
|
- Fake providers (provider.py)
|
|
- Fake platforms (platform.py)
|
|
|
|
Usage:
|
|
from tests.factories import FakeApp, text_query, FakeProvider
|
|
|
|
app = FakeApp()
|
|
query = text_query("hello")
|
|
provider = FakeProvider.returns("response")
|
|
"""
|
|
|
|
from tests.factories.app import FakeApp, fake_app
|
|
from tests.factories.message import (
|
|
text_chain,
|
|
group_text_chain,
|
|
mention_chain,
|
|
image_chain,
|
|
text_query,
|
|
group_text_query,
|
|
private_text_query,
|
|
command_query,
|
|
mention_query,
|
|
empty_query,
|
|
)
|
|
|
|
__all__ = [
|
|
# App
|
|
"FakeApp",
|
|
"fake_app",
|
|
# Message chains
|
|
"text_chain",
|
|
"group_text_chain",
|
|
"mention_chain",
|
|
"image_chain",
|
|
# Queries
|
|
"text_query",
|
|
"group_text_query",
|
|
"private_text_query",
|
|
"command_query",
|
|
"mention_query",
|
|
"empty_query",
|
|
] |