chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:39:17 +08:00
commit 4ed4e9ff99
1368 changed files with 334957 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
from pathlib import Path
from agents.sandbox.session.tar_workspace import shell_tar_exclude_args
def test_shell_tar_exclude_args_skips_empty_and_dot_paths() -> None:
assert shell_tar_exclude_args([Path(""), Path("."), Path("/")]) == []
def test_shell_tar_exclude_args_sorts_and_adds_plain_and_dot_prefixed_patterns() -> None:
assert shell_tar_exclude_args(
[
Path("logs/events.jsonl"),
Path("cache dir/file.txt"),
]
) == [
"--exclude='cache dir/file.txt'",
"--exclude='./cache dir/file.txt'",
"--exclude=logs/events.jsonl",
"--exclude=./logs/events.jsonl",
]
def test_shell_tar_exclude_args_normalizes_absolute_paths() -> None:
assert shell_tar_exclude_args([Path("/tmp/workspace/cache")]) == [
"--exclude=tmp/workspace/cache",
"--exclude=./tmp/workspace/cache",
]