27 lines
865 B
Python
27 lines
865 B
Python
"""Unit tests for gateway.cwd_placeholder.resolve_placeholder_terminal_cwd."""
|
|
|
|
from gateway.cwd_placeholder import resolve_placeholder_terminal_cwd
|
|
|
|
|
|
class TestResolvePlaceholderTerminalCwd:
|
|
def test_local_placeholder_uses_messaging_cwd(self):
|
|
assert resolve_placeholder_terminal_cwd(
|
|
configured_cwd=".",
|
|
terminal_backend="local",
|
|
messaging_cwd="/home/user/project",
|
|
docker_mount_cwd_to_workspace=False,
|
|
home_fallback="/home/user",
|
|
) == "/home/user/project"
|
|
|
|
|
|
def test_docker_placeholder_mount_off_unset(self):
|
|
assert resolve_placeholder_terminal_cwd(
|
|
configured_cwd=".",
|
|
terminal_backend="docker",
|
|
messaging_cwd="/home/user",
|
|
docker_mount_cwd_to_workspace=False,
|
|
home_fallback="/home/user",
|
|
) is None
|
|
|
|
|