"""Tests for the suggest module."""

from mcp_diet.analyzer import analyze_tools
from mcp_diet.suggest import generate_suggestions
from tests.fixtures.sample_tools import ALL_TOOLS, BLOATED_TOOL, MINIMAL_TOOL


class TestGenerateSuggestions:
    def test_bloated_tool_gets_suggestions(self):
        summary = analyze_tools(ALL_TOOLS)
        suggestions = generate_suggestions(summary)
        tool_names = [s.tool_name for s in suggestions]
        assert BLOATED_TOOL.name in tool_names

    def test_minimal_tool_no_suggestions(self):
        summary = analyze_tools([MINIMAL_TOOL])
        suggestions = generate_suggestions(summary)
        assert len(suggestions) == 0

    def test_suggestions_have_category(self):
        summary = analyze_tools(ALL_TOOLS)
        suggestions = generate_suggestions(summary)
        for s in suggestions:
            assert s.category
            assert s.message
