mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-20 02:55:08 +08:00
test: comprehensive test coverage and type fixes
- 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
This commit is contained in:
32
tests/test_star_handler.py
Normal file
32
tests/test_star_handler.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""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")
|
||||
Reference in New Issue
Block a user