test(delivery): build the expected docker mount path with os.path.join

The adapter builds the work dir with os.path.join, so the expected string is
built the same way rather than hard-coded with "/" — otherwise the assertion
fails on Windows, where the separator is a backslash. The security property
(exactly one bind mount, and it is the work tree) is platform-neutral.

Full suite: 537 tests, 0 failures, 3 skipped (docker/deploy_it integration).
This commit is contained in:
Agent 3
2026-10-14 13:32:43 +03:30
parent cfcc520f46
commit c93b25741e
+7 -1
View File
@@ -234,7 +234,13 @@ async def test_start_session_mounts_only_the_work_tree(tmp_path):
argv = runner.last_argv
mounts = [argv[i + 1] for i, token in enumerate(argv) if token == "-v"]
assert mounts == [f"{tmp_path}/org1/proj1/work:/workspace"], (
# The adapter builds the host path with ``os.path.join``, so the expected
# string is built the same way rather than hard-coded with "/" — otherwise
# the assertion fails on Windows, where the separator is a backslash. The
# security property (exactly one bind mount, and it is the work tree) is
# platform-neutral.
expected = os.path.join(str(tmp_path), "org1", "proj1", "work")
assert mounts == [f"{expected}:/workspace"], (
"exactly one bind mount, and it is the work tree"
)
assert not any("git" in mount for mount in mounts)