ligbox-ops-platform/projects/ops-desk/api/tests/test_agents_034_kimi.py
Ligbox Spec Hub 6c4b063f76 Implement Spec 027 access matrix preview and agent bindings enforcement.
Adds RBAC matrix API/UI behind feature flags, agent×role toggles with audit,
and extends Agentic Ops with streaming chat, Kimi LLM support, and UI updates.
2026-06-20 22:02:03 +00:00

26 lines
888 B
Python

"""Tests Spec 034 — KIMI LLM provider."""
from __future__ import annotations
import os
from unittest.mock import patch
from app.agents import llm_client
def test_resolve_provider_auto_kimi_when_key():
with patch.dict(os.environ, {"AGENTIC_LLM_ENABLED": "true", "AGENTIC_LLM_PROVIDER": "auto", "KIMI_API_KEY": "sk-test"}, clear=False):
import importlib
importlib.reload(llm_client)
assert llm_client.resolve_provider() == "kimi"
def test_clean_env_strips_inline_comment():
assert llm_client._clean_env("kimi-k2.5 # comment") == "kimi-k2.5"
assert llm_client._clean_env("https://api.moonshot.ai/v1 # internacional") == "https://api.moonshot.ai/v1"
def test_llm_status_includes_provider():
status = llm_client.llm_status()
assert "provider" in status
assert "model" in status
assert "kimi_configured" in status