"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit."""

from __future__ import annotations

import pytest

from {{ module_name }}.auth.errors import MissingCredentialsError
from {{ module_name }}.auth.strategies.api_key import ApiKeyStrategy


async def test_carries_the_configured_api_key_through() -> None:
    strategy = ApiKeyStrategy()
    credentials = await strategy.authenticate({"api_key": "abc123"})
    assert credentials["api_key"] == "abc123"


async def test_rejects_a_config_missing_the_api_key() -> None:
    strategy = ApiKeyStrategy()
    with pytest.raises(MissingCredentialsError):
        await strategy.authenticate({})


def test_rejects_an_empty_api_key_as_invalid() -> None:
    strategy = ApiKeyStrategy()
    assert not strategy.validate_credentials({"api_key": ""})
