update
This commit is contained in:
@@ -52,6 +52,18 @@ class TestResolveMounts:
|
||||
mounts = resolve_mounts(tmp_path, dotfiles_dir=dotfiles)
|
||||
assert any(m.target.endswith("/flow/dotfiles") for m in mounts)
|
||||
|
||||
def test_socket_path_mount(self, tmp_path):
|
||||
sock = tmp_path / "docker.sock"
|
||||
sock.write_text("")
|
||||
mounts = resolve_mounts(tmp_path, socket_path=sock)
|
||||
socket_mounts = [m for m in mounts if m.target == "/var/run/docker.sock"]
|
||||
assert len(socket_mounts) == 1
|
||||
assert socket_mounts[0].source == sock
|
||||
|
||||
def test_no_socket_path(self, tmp_path):
|
||||
mounts = resolve_mounts(tmp_path)
|
||||
assert not any(m.target == "/var/run/docker.sock" for m in mounts)
|
||||
|
||||
|
||||
class TestBuildContainerSpec:
|
||||
def test_basic(self):
|
||||
@@ -68,10 +80,12 @@ class TestBuildContainerSpec:
|
||||
|
||||
|
||||
class TestMount:
|
||||
def test_to_flag(self):
|
||||
def test_fields(self):
|
||||
m = Mount(source=Path("/src"), target="/dst")
|
||||
assert m.to_flag() == "-v /src:/dst"
|
||||
assert m.source == Path("/src")
|
||||
assert m.target == "/dst"
|
||||
assert m.readonly is False
|
||||
|
||||
def test_to_flag_readonly(self):
|
||||
def test_readonly(self):
|
||||
m = Mount(source=Path("/src"), target="/dst", readonly=True)
|
||||
assert ":ro" in m.to_flag()
|
||||
assert m.readonly is True
|
||||
|
||||
Reference in New Issue
Block a user