fix: properly mock Docker container image in tests
This commit is contained in:
@@ -101,11 +101,19 @@ def mock_docker_client():
|
|||||||
"""Mock Docker client for testing."""
|
"""Mock Docker client for testing."""
|
||||||
client = Mock()
|
client = Mock()
|
||||||
|
|
||||||
|
# Mock container image
|
||||||
|
mock_image = Mock()
|
||||||
|
mock_image.tags = ["test-image:latest"]
|
||||||
|
mock_image.id = "sha256:abc123def456"
|
||||||
|
|
||||||
# Mock container
|
# Mock container
|
||||||
container = Mock()
|
container = Mock()
|
||||||
container.id = "abc123"
|
container.id = "abc123"
|
||||||
|
container.short_id = "abc123"
|
||||||
container.name = "test-container"
|
container.name = "test-container"
|
||||||
container.status = "running"
|
container.status = "running"
|
||||||
|
container.image = mock_image
|
||||||
|
container.ports = {"80/tcp": [{"HostPort": "8080"}]}
|
||||||
container.attrs = {
|
container.attrs = {
|
||||||
"State": {"Health": {"Status": "healthy"}},
|
"State": {"Health": {"Status": "healthy"}},
|
||||||
"Config": {"Image": "test-image:latest"}
|
"Config": {"Image": "test-image:latest"}
|
||||||
|
|||||||
Reference in New Issue
Block a user