mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
- Add 100+ new test files covering provider sources, platform adapters, agent runners, star/plugin system, knowledge base, core utils, pipeline, computer tools, builtin commands, and dashboard routes - Fix Python type errors in sqlite.py (col() wrappers for SQLModel), astr_agent_tool_exec, core_lifecycle, star context/manager - Fix TypeScript strict mode errors across 30+ dashboard Vue files - Add import smoke tests, auth roundtrip, startup tests - Add compile-all check and CLI entry test for AUR compatibility - Restore BotMessageAccumulator and helpers lost in merge
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""Import smoke tests for astrbot.core.star.star_handler."""
|
|
from astrbot.core.star.star_handler import (
|
|
StarHandlerRegistry,
|
|
StarHandlerMetadata,
|
|
EventType,
|
|
star_handlers_registry,
|
|
)
|
|
|
|
|
|
def test_star_handler_registry_class():
|
|
"""StarHandlerRegistry is importable and is a class."""
|
|
assert isinstance(StarHandlerRegistry, type)
|
|
|
|
|
|
def test_star_handler_registry_default_instance():
|
|
"""star_handlers_registry is a module-level StarHandlerRegistry instance."""
|
|
assert isinstance(star_handlers_registry, StarHandlerRegistry)
|
|
|
|
|
|
def test_star_handler_metadata_class():
|
|
"""StarHandlerMetadata is importable and is a dataclass."""
|
|
assert isinstance(StarHandlerMetadata, type)
|
|
|
|
|
|
def test_event_type_enum():
|
|
"""EventType is an enum with expected members."""
|
|
assert hasattr(EventType, "AdapterMessageEvent")
|
|
assert hasattr(EventType, "OnLLMRequestEvent")
|
|
assert hasattr(EventType, "OnLLMResponseEvent")
|
|
assert hasattr(EventType, "OnAstrBotLoadedEvent")
|
|
assert hasattr(EventType, "OnPluginLoadedEvent")
|
|
assert hasattr(EventType, "OnPluginUnloadedEvent")
|