Complete action runtime rewrite
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"""Tests for flow.core.containers."""
|
||||
"""Tests for flow.adapters.containers."""
|
||||
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from flow.core.containers import ContainerRuntime
|
||||
from flow.adapters.containers import ContainerRuntime
|
||||
from flow.core.errors import FlowError
|
||||
|
||||
from tests.fakes import FakeRunner
|
||||
@@ -53,7 +53,7 @@ class TestMode:
|
||||
rootful.write_text("")
|
||||
compat.write_text("")
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [rootful, rootless, compat],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), mode="podman-rootful", binary="podman")
|
||||
@@ -65,7 +65,7 @@ class TestMode:
|
||||
rootless.write_text("")
|
||||
rootful.write_text("")
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [rootless, rootful],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), mode="podman", binary="podman")
|
||||
@@ -77,7 +77,7 @@ class TestSocketPath:
|
||||
sock = tmp_path / "docker.sock"
|
||||
sock.write_text("")
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [sock],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), binary="docker")
|
||||
@@ -85,7 +85,7 @@ class TestSocketPath:
|
||||
|
||||
def test_docker_socket_missing(self, monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [Path("/nonexistent/docker.sock")],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), binary="docker")
|
||||
@@ -97,7 +97,7 @@ class TestSocketPath:
|
||||
rootless.write_text("")
|
||||
rootful.write_text("")
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [rootless, rootful],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), binary="podman")
|
||||
@@ -107,7 +107,7 @@ class TestSocketPath:
|
||||
rootful = tmp_path / "rootful.sock"
|
||||
rootful.write_text("")
|
||||
monkeypatch.setattr(
|
||||
"flow.core.containers.ContainerRuntime._socket_candidates",
|
||||
"flow.adapters.containers.ContainerRuntime._socket_candidates",
|
||||
lambda self: [Path("/nonexistent"), rootful],
|
||||
)
|
||||
rt = ContainerRuntime(FakeRunner(), binary="podman")
|
||||
|
||||
Reference in New Issue
Block a user