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

from __future__ import annotations

import pytest

from {{ module_name }}.core.errors import RateLimitExceededError
from {{ module_name }}.core.rate_limiter import RateLimiter


def test_allows_calls_up_to_the_limit() -> None:
    limiter = RateLimiter(limit=3, window_s=1.0)
    for _ in range(3):
        limiter.acquire()


def test_rejects_calls_beyond_the_limit_within_the_window() -> None:
    limiter = RateLimiter(limit=1, window_s=60.0)
    limiter.acquire()
    with pytest.raises(RateLimitExceededError):
        limiter.acquire()
