"""Langfuse集成测试"""
import pytest
import sys
sys.path.insert(0, '/home/jang/Projects/ai-researcher')

from src.integrations.langfuse_client import LangfuseClient


def test_langfuse_disabled_without_config():
    """测试无配置时Langfuse被禁用"""
    client = LangfuseClient()
    # 默认配置为空，应该被禁用
    assert client.enabled == False


def test_get_headers_format():
    """测试请求头格式"""
    client = LangfuseClient()
    client.public_key = 'pk-test'
    client.secret_key = 'sk-test'
    client.enabled = True

    headers = client._get_headers()

    assert 'Authorization' in headers
    assert headers['Authorization'].startswith('Basic ')
    assert headers['Content-Type'] == 'application/json'
