From d35bc330eb9fcfac65ee1a3296cfc423af96cf31 Mon Sep 17 00:00:00 2001 From: "Victor M. SMITH" <72023257+MVS-source@users.noreply.github.com> Date: Fri, 10 Jul 2026 18:32:22 +0200 Subject: [PATCH] test(edenai): move live integration tests out of the unit suite Per review: keep only unit/mocked tests here; live API tests move to tests/e2e/test_edenai_e2e.py. --- .../llms/openai_like/test_edenai.py | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/tests/test_litellm/llms/openai_like/test_edenai.py b/tests/test_litellm/llms/openai_like/test_edenai.py index e644ac86818..9f8e1f265d9 100644 --- a/tests/test_litellm/llms/openai_like/test_edenai.py +++ b/tests/test_litellm/llms/openai_like/test_edenai.py @@ -105,70 +105,3 @@ class TestEdenAICompletionMocked: assert hasattr(response, "choices") assert len(response.choices) > 0 assert response.choices[0].message.content == "PING" - - -class TestEdenAILiveIntegration: - """Live integration tests against the real Eden AI API. - - Skipped automatically when EDENAI_API_KEY is not set, so CI without the - secret stays green. When the key is present (local dev, or a dedicated - integration runner) these validate that each endpoint flagged `true` in - provider_endpoints_support.json actually routes a request through to - api.edenai.run/v3 end-to-end. Endpoints flagged `false` (`/responses`, - `/embeddings`, `/image/generations`, `/audio/*`, `/moderations`, - `/batches`, `/rerank`) intentionally have no live test here; their - handlers ship in follow-up PRs and the tests come with them. - """ - - @pytest.mark.skipif( - not os.environ.get("EDENAI_API_KEY"), reason="EDENAI_API_KEY not set" - ) - def test_edenai_live_chat_completions(self): - """`/v1/chat/completions` via litellm.completion() — the openai_like - loader's primary surface.""" - response = litellm.completion( - model="edenai/openai/gpt-4o-mini", - messages=[ - { - "role": "user", - "content": "Reply with 'PING' and nothing else.", - } - ], - max_tokens=8, - ) - - assert response is not None - assert response.choices[0].message.content - assert response.usage is not None - assert response.usage.total_tokens > 0 - - @pytest.mark.skipif( - not os.environ.get("EDENAI_API_KEY"), reason="EDENAI_API_KEY not set" - ) - @pytest.mark.asyncio - async def test_edenai_live_anthropic_messages(self): - """`/v1/messages` (Anthropic-format) via litellm.anthropic_messages(). - LiteLLM translates the Anthropic-shape request to OpenAI shape - internally and routes through Eden AI's openai-compatible endpoint; - the response is translated back to Anthropic shape before being - returned to the caller.""" - response = await litellm.anthropic_messages( - model="edenai/anthropic/claude-opus-4-6", - messages=[ - { - "role": "user", - "content": "Reply with 'MSG' and nothing else.", - } - ], - max_tokens=8, - ) - - assert response is not None - # anthropic_messages returns a dict (Anthropic-shape response) - assert response.get("type") == "message" - assert response.get("role") == "assistant" - content = response.get("content", []) - assert content and content[0].get("type") == "text" - assert content[0].get("text") - usage = response.get("usage", {}) - assert usage.get("total_tokens", 0) > 0