refactor: move server/ to tools/server/

This commit is contained in:
2026-05-12 00:37:47 +08:00
parent e0b3b012e7
commit d1ecb13175
7 changed files with 5 additions and 5 deletions

View File

@@ -7,8 +7,8 @@ import pytest
import pytest_asyncio import pytest_asyncio
from httpx import ASGITransport, AsyncClient from httpx import ASGITransport, AsyncClient
from ai_mouse.server import create_app from tools.server import create_app
from ai_mouse.server.deps import get_data_dir from tools.server.deps import get_data_dir
@pytest.fixture @pytest.fixture
@@ -87,7 +87,7 @@ class TestCollect:
async def test_collect_trace_increments_count(self, client, tmp_path, monkeypatch): async def test_collect_trace_increments_count(self, client, tmp_path, monkeypatch):
"""Test that posting a trace increments the collected count.""" """Test that posting a trace increments the collected count."""
# Monkeypatch data dir to use tmp # Monkeypatch data dir to use tmp
import ai_mouse.server.deps as deps import tools.server.deps as deps
monkeypatch.setattr(deps, "_DATA_DIR", tmp_path) monkeypatch.setattr(deps, "_DATA_DIR", tmp_path)
# Start collection # Start collection
@@ -124,7 +124,7 @@ class TestVerify:
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_verify_returns_paths(self, client, model_dir, monkeypatch): async def test_verify_returns_paths(self, client, model_dir, monkeypatch):
"""Test trajectory generation endpoint.""" """Test trajectory generation endpoint."""
import ai_mouse.server.routes_verify as rv import tools.server.routes_verify as rv
# We can't easily monkeypatch the model dir used inside the route # We can't easily monkeypatch the model dir used inside the route
# but we can test the endpoint is accessible # but we can test the endpoint is accessible
resp = await client.post( resp = await client.post(

View File

@@ -77,7 +77,7 @@ async def _train_sse_generator(req: TrainRequest) -> AsyncGenerator[str, None]:
queue.put_nowait(msg) queue.put_nowait(msg)
async def run_training_async() -> None: async def run_training_async() -> None:
from ai_mouse.trainer import train from tools.trainer import train
traces_path, models_dir, pretrained_dir = _paths() traces_path, models_dir, pretrained_dir = _paths()
data_path = Path(req.data_path) if req.data_path else traces_path data_path = Path(req.data_path) if req.data_path else traces_path