Add comprehensive Docker containers management page with filtering, search, bulk actions, and enhanced container control with state verification
This commit is contained in:
@@ -100,6 +100,35 @@ class TestDockerHostsRoutes:
|
||||
class TestDockerContainersRoutes:
|
||||
"""Tests for Docker containers endpoints."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_all_containers(self, client: AsyncClient, api_key_header, db_session):
|
||||
"""Test listing all containers across all hosts (aggregated endpoint)."""
|
||||
response = await client.get(
|
||||
"/api/docker/containers",
|
||||
headers=api_key_header
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "containers" in data
|
||||
assert "total" in data
|
||||
assert "running" in data
|
||||
assert "stopped" in data
|
||||
assert "paused" in data
|
||||
assert "hosts_count" in data
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_all_containers_with_filters(self, client: AsyncClient, api_key_header, db_session):
|
||||
"""Test listing all containers with query filters."""
|
||||
response = await client.get(
|
||||
"/api/docker/containers?state=running",
|
||||
headers=api_key_header
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "containers" in data
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_list_containers(self, client: AsyncClient, api_key_header, db_session):
|
||||
"""Test listing containers for a host."""
|
||||
|
||||
Reference in New Issue
Block a user