mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +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
46 lines
1.7 KiB
Python
46 lines
1.7 KiB
Python
"""Import smoke tests for Local booter."""
|
|
|
|
import pytest
|
|
|
|
|
|
class TestLocalBooterImports:
|
|
"""Verify local.py module can be imported and key classes exist."""
|
|
|
|
def test_module_import(self):
|
|
"""Import the module without error."""
|
|
from astrbot.core.computer.booters import local
|
|
assert local is not None
|
|
|
|
def test_local_booter_class(self):
|
|
"""LocalBooter is present and subclasses ComputerBooter."""
|
|
from astrbot.core.computer.booters.base import ComputerBooter
|
|
from astrbot.core.computer.booters.local import LocalBooter
|
|
assert LocalBooter is not None
|
|
assert issubclass(LocalBooter, ComputerBooter)
|
|
|
|
def test_local_shell_component(self):
|
|
"""LocalShellComponent is present."""
|
|
from astrbot.core.computer.booters.local import LocalShellComponent
|
|
assert LocalShellComponent is not None
|
|
|
|
def test_local_python_component(self):
|
|
"""LocalPythonComponent is present."""
|
|
from astrbot.core.computer.booters.local import LocalPythonComponent
|
|
assert LocalPythonComponent is not None
|
|
|
|
def test_local_filesystem_component(self):
|
|
"""LocalFileSystemComponent is present."""
|
|
from astrbot.core.computer.booters.local import LocalFileSystemComponent
|
|
assert LocalFileSystemComponent is not None
|
|
|
|
def test_utility_functions(self):
|
|
"""Key utility functions are importable."""
|
|
from astrbot.core.computer.booters.local import (
|
|
_is_safe_command,
|
|
_ensure_safe_path,
|
|
_decode_bytes_with_fallback,
|
|
)
|
|
assert callable(_is_safe_command)
|
|
assert callable(_ensure_safe_path)
|
|
assert callable(_decode_bytes_with_fallback)
|