from mcsci_hub.clients.rate_limiter import AsyncRateLimiter


async def test_acquire_within_burst():
    limiter = AsyncRateLimiter(rate=10.0, burst=3)
    # Should not block for first 3 calls
    for _ in range(3):
        await limiter.acquire()


async def test_acquire_beyond_burst():
    limiter = AsyncRateLimiter(rate=100.0, burst=1)
    await limiter.acquire()  # uses the 1 token
    # Next acquire should need to wait briefly
    await limiter.acquire()  # should complete (high rate refills fast)
