Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
import os
|
|
|
|
import pytest
|
|
|
|
from teamlandkarte_mcp.azure.openai_client import AzureOpenAIClient
|
|
from teamlandkarte_mcp.config import load_config
|
|
|
|
# Allow these smoke tests to access the real Azure OpenAI endpoint when the
|
|
# required env/config is present.
|
|
pytestmark = [pytest.mark.integration, pytest.mark.allow_network]
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_azure_openai_chat_completion_smoke() -> None:
|
|
"""Smoke test against a real Azure OpenAI resource (chat completion)."""
|
|
|
|
cfg = load_config("config.toml")
|
|
endpoint = (cfg.azure_openai.endpoint or "").strip()
|
|
llm_key = os.getenv("AZURE_OPENAI_LLM_API_KEY", "").strip()
|
|
|
|
if not endpoint:
|
|
pytest.skip("Azure OpenAI endpoint missing in config.toml")
|
|
if "YOUR-RESOURCE" in endpoint.upper():
|
|
pytest.skip("Azure OpenAI endpoint in config.toml is still a placeholder")
|
|
if not endpoint.startswith("https://"):
|
|
pytest.skip("Azure OpenAI endpoint must start with https://")
|
|
if not llm_key:
|
|
pytest.skip("AZURE_OPENAI_LLM_API_KEY is not set")
|
|
if not cfg.azure_openai.chat_deployment:
|
|
pytest.skip("chat_deployment not configured")
|
|
|
|
client = AzureOpenAIClient(
|
|
endpoint=endpoint,
|
|
api_version=cfg.azure_openai.api_version,
|
|
chat_deployment=cfg.azure_openai.chat_deployment,
|
|
llm_api_key=llm_key,
|
|
)
|
|
|
|
result = await client.chat_completion(
|
|
system="You are a test assistant. Respond with JSON: {\"status\": \"ok\"}",
|
|
user="ping",
|
|
)
|
|
assert isinstance(result, str)
|
|
assert "ok" in result
|