Files
AstrBot/tests/test_cmd_init.py
LIghtJUNction 98a8502ebe fix: resolve asynchronous context manager and coroutine attribute issues
- Fixed '_GeneratorContextManager' error in pip_installer.py by using synchronous 'with' for constraints_file().
- Fixed 'CoroutineType' has no attribute 'is_file' in dashboard/routes/config.py by adding missing await.
- Fixed undefined names (Group, ComponentTypes, File, Reply, At) in aiocqhttp_platform_adapter.py.
- Added 'pytest-cov' for code coverage testing.
2026-03-18 22:35:49 +08:00

22 lines
492 B
Python

from __future__ import annotations
from pathlib import Path
import pytest
from astrbot.cli.commands.cmd_init import initialize_astrbot
@pytest.mark.asyncio
async def test_initialize_astrbot_creates_skills_dir(tmp_path: Path) -> None:
await initialize_astrbot(
tmp_path,
yes=True,
backend_only=True,
admin_username=None,
admin_password=None,
)
assert (tmp_path / ".astrbot").exists()
assert (tmp_path / "data" / "skills").is_dir()