"""Tests for {{ name }}.

These tests verify that the agent implements the
SpecialistAgent protocol correctly and that tools are defined.
"""

import pytest

from {{ agent_slug }} import CAPABILITIES, {{ agent_class }}
from {{ agent_slug }}.tools import get_alerts, get_service_status, get_services


class Test{{ agent_class }}:
    """Tests for {{ agent_class }}."""

    def test_has_required_attributes(self) -> None:
        """Agent has required protocol attributes."""
        agent = {{ agent_class }}()
        assert hasattr(agent, "name")
        assert hasattr(agent, "capabilities")
        assert agent.name == "{{ agent_slug }}"

    def test_capabilities_not_empty(self) -> None:
        """Capabilities description is not empty."""
        assert CAPABILITIES
        assert len(CAPABILITIES) > 0

    def test_has_run_method(self) -> None:
        """Agent has async run method."""
        agent = {{ agent_class }}()
        assert hasattr(agent, "run")
        assert callable(agent.run)

    def test_has_as_tool_method(self) -> None:
        """Agent has as_tool method."""
        agent = {{ agent_class }}()
        assert hasattr(agent, "as_tool")
        assert callable(agent.as_tool)


class TestTools:
    """Tests for agent tools."""

    def test_get_services_is_callable(self) -> None:
        """get_services tool is defined and callable."""
        assert get_services is not None
        assert hasattr(get_services, "ainvoke")

    def test_get_service_status_is_callable(self) -> None:
        """get_service_status tool is defined and callable."""
        assert get_service_status is not None
        assert hasattr(get_service_status, "ainvoke")

    def test_get_alerts_is_callable(self) -> None:
        """get_alerts tool is defined and callable."""
        assert get_alerts is not None
        assert hasattr(get_alerts, "ainvoke")

    def test_tools_have_descriptions(self) -> None:
        """All tools have descriptions for the LLM."""
        tools = [get_services, get_service_status, get_alerts]
        for tool in tools:
            assert tool.description, f"Tool {tool.name} has no description"
