Files
Octop/tests/unit/test_shared.py
jubaoliangandCursor 1af14b8031 chore: wire shared agents, SSO, experts, ONNX, and knowledge into the app
Register routers/repos/migrations, OpenAPI tags, i18n/error codes, sidebar routes, and docs for the new platform capabilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 18:56:23 +08:00

29 lines
919 B
Python

"""tests/unit/test_shared.py"""
from __future__ import annotations
from pathlib import Path
from octop.config import OctopConfig
from octop.infra.db.migrate import run_migrations
from octop.infra.db.pool import SqlitePool
from octop.infra.db.repos.sso import SsoRepo
from octop.infra.db.services import SharedServices, build_shared_services
from octop.infra.utils.paths import PathLayout
def test_build_shared_services(tmp_path: Path):
cfg = OctopConfig()
paths = PathLayout(tmp_path / ".octop")
paths.ensure_root()
db = SqlitePool(paths.db)
run_migrations(db)
services = build_shared_services(db=db, paths=paths, config=cfg)
assert isinstance(services, SharedServices)
assert services.db is db
assert services.paths is paths
assert services.config is cfg
# all repos resolved
assert services.user_repo.count() == 0
assert isinstance(services.sso_repo, SsoRepo)