mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
feat(events): Expand MessageEvent with reply capabilities and detailed docstrings fix(loader): Ensure plugin path is correctly managed in sys.path feat(star): Improve Star class documentation and lifecycle method descriptions feat(testing): Add plugin metadata handling in MockContext and enhance PluginHarness feat(hello): Refactor HelloPlugin to utilize new reply methods and structured capabilities test(decorators): Add tests for input/output model support in provide_capability test(events): Implement tests for reply_image and reply_chain methods in MessageEvent test(http): Validate API registration with capability handler references and error handling test(tests): Enhance tests for plugin harness and directory handling in dev commands
16 lines
407 B
Python
16 lines
407 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from astrbot_sdk.testing import PluginHarness
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_dispatch_hello_command() -> None:
|
|
plugin_dir = Path(__file__).resolve().parents[1]
|
|
|
|
async with PluginHarness.from_plugin_dir(plugin_dir) as harness:
|
|
records = await harness.dispatch_text("hello")
|
|
|
|
assert any(record.text == "Hello, World!" for record in records)
|