"""Redis instance endpoint tests — Go/Gin backend.""" import pytest from httpx import AsyncClient from tests.conftest import auth_header class TestRedisInfo: async def test_redis_info(self, client: AsyncClient, admin_token: str, test_redis_instance): resp = await client.get( f"/api/v1/redis/{test_redis_instance['id']}/info", headers=auth_header(admin_token), ) assert resp.status_code == 200 async def test_redis_dbsize(self, client: AsyncClient, admin_token: str, test_redis_instance): resp = await client.get( f"/api/v1/redis/{test_redis_instance['id']}/dbsize", headers=auth_header(admin_token), ) assert resp.status_code == 200 async def test_redis_slowlog(self, client: AsyncClient, admin_token: str, test_redis_instance): resp = await client.get( f"/api/v1/redis/{test_redis_instance['id']}/slowlog", headers=auth_header(admin_token), ) assert resp.status_code == 200 async def test_redis_clients(self, client: AsyncClient, admin_token: str, test_redis_instance): resp = await client.get( f"/api/v1/redis/{test_redis_instance['id']}/clients", headers=auth_header(admin_token), ) assert resp.status_code == 200 async def test_no_auth(self, client: AsyncClient): resp = await client.get("/api/v1/redis/2/info") assert resp.status_code == 401