mirror of
https://github.com/nenadilic84/claudex.git
synced 2025-10-28 08:12:06 -07:00
- Create claudex proxy for Anthropic-to-OpenAI API conversion - Fix package setup in pyproject.toml - Add environment variable mocking in tests - Include example configuration
21 lines
588 B
Python
21 lines
588 B
Python
from fastapi.testclient import TestClient
|
|
import unittest.mock
|
|
import os
|
|
|
|
# Mock environment variables before importing app
|
|
with unittest.mock.patch.dict(os.environ, {
|
|
'TARGET_API_BASE': 'https://api.example.com',
|
|
'TARGET_API_KEY': 'mock-api-key',
|
|
'BIG_MODEL_TARGET': 'model-large',
|
|
'SMALL_MODEL_TARGET': 'model-small'
|
|
}):
|
|
from claudex.proxy import app
|
|
|
|
def test_health_check():
|
|
client = TestClient(app)
|
|
response = client.get("/")
|
|
assert response.status_code == 200
|
|
data = response.json()
|
|
assert data["status"] == "ok"
|
|
assert "message" in data
|