# tests/unit/test_main.py
import pytest
from fastapi.testclient import TestClient

import sys
sys.path.insert(0, '/home/jang/Projects/ai-researcher')

from src.main import app

client = TestClient(app)


def test_health_endpoint():
    """测试健康检查端点"""
    response = client.get("/health")
    assert response.status_code == 200
    assert response.json() == {"status": "ok"}


def test_api_version():
    """测试API版本信息"""
    response = client.get("/api/v1/")
    assert response.status_code == 200
    data = response.json()
    assert "version" in data
    assert "name" in data
