mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-09 20:50:58 +00:00
feat(test): add shared test factories package
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>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
"""
|
||||
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",
|
||||
]
|
||||
Reference in New Issue
Block a user