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:
@@ -234,7 +234,13 @@ async def test_start_session_mounts_only_the_work_tree(tmp_path):
|
|||||||
|
|
||||||
argv = runner.last_argv
|
argv = runner.last_argv
|
||||||
mounts = [argv[i + 1] for i, token in enumerate(argv) if token == "-v"]
|
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"
|
"exactly one bind mount, and it is the work tree"
|
||||||
)
|
)
|
||||||
assert not any("git" in mount for mount in mounts)
|
assert not any("git" in mount for mount in mounts)
|
||||||
|
|||||||
Reference in New Issue
Block a user