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
59 lines
1.6 KiB
Python
59 lines
1.6 KiB
Python
"""Import smoke tests for config and platform route modules.
|
|
|
|
Verifies that all public classes and key standalone functions from
|
|
``config.py`` and ``platform.py`` can be imported without errors.
|
|
"""
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# config.py — ConfigRoute and standalone helpers
|
|
# ---------------------------------------------------------------------------
|
|
from astrbot.dashboard.routes.config import (
|
|
ConfigRoute, # noqa: F401
|
|
save_config, # noqa: F401
|
|
validate_config, # noqa: F401
|
|
try_cast, # noqa: F401
|
|
_expect_type, # noqa: F401
|
|
_validate_template_list, # noqa: F401
|
|
_log_computer_config_changes, # noqa: F401
|
|
)
|
|
|
|
|
|
def test_config_route_class():
|
|
assert ConfigRoute is not None
|
|
|
|
|
|
def test_save_config_is_callable():
|
|
assert callable(save_config)
|
|
|
|
|
|
def test_validate_config_is_callable():
|
|
assert callable(validate_config)
|
|
|
|
|
|
def test_try_cast_is_callable():
|
|
assert callable(try_cast)
|
|
|
|
|
|
def test_expect_type_is_callable():
|
|
assert callable(_expect_type)
|
|
|
|
|
|
def test_validate_template_list_is_callable():
|
|
assert callable(_validate_template_list)
|
|
|
|
|
|
def test_log_computer_config_changes_is_callable():
|
|
assert callable(_log_computer_config_changes)
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# platform.py — PlatformRoute
|
|
# ---------------------------------------------------------------------------
|
|
from astrbot.dashboard.routes.platform import (
|
|
PlatformRoute, # noqa: F401
|
|
)
|
|
|
|
|
|
def test_platform_route_class():
|
|
assert PlatformRoute is not None
|