Add comprehensive Docker containers management page with filtering, search, bulk actions, and enhanced container control with state verification

This commit is contained in:
2025-12-15 23:54:45 -05:00
parent 68a9b0f390
commit 230387a14e
50 changed files with 10856 additions and 35 deletions
+29
View File
@@ -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."""