"""Tests Agentic Ops — Spec 029."""
from __future__ import annotations

import sqlite3

from app.agents import checks, registry, store


def test_registry_has_vm123_scenarios():
    scenarios = registry.load_registry()
    ids = {s["id"] for s in scenarios}
    assert "ollama.vm123.health" in ids
    assert "vm123.finance.stack" in ids


def test_agent_schema_init():
    conn = sqlite3.connect(":memory:")
    store.init_agent_schema(conn)
    tables = {r[0] for r in conn.execute("SELECT name FROM sqlite_master WHERE type='table'")}
    assert "agent_findings" in tables
    assert "agent_scenarios" in tables


def test_desk_health_check_returns_list():
    result = checks.check_desk_api_health()
    assert isinstance(result, list)
