Add controlled coding agent automation
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-08-21 22:49:49 +02:00
parent 9bac41f071
commit bfa5cdcd3e
25 changed files with 1263 additions and 1 deletions

28
tests/test_git.py Normal file
View File

@@ -0,0 +1,28 @@
import subprocess
from test_config import settings
from lai_automation.git import GitWorkspace
def test_test_command_does_not_interpret_shell_metacharacters(tmp_path) -> None:
workspace = GitWorkspace(settings(workspace_root=tmp_path), 1)
workspace.path.mkdir()
result = workspace.run("printf safe ; touch injected", check=False)
assert result.stdout == "safe"
assert result.returncode != 0
assert not (workspace.path / "injected").exists()
def test_summary_includes_untracked_files(tmp_path) -> None:
workspace = GitWorkspace(settings(workspace_root=tmp_path), 2)
workspace.path.mkdir()
subprocess.run(["git", "init"], cwd=workspace.path, check=True, capture_output=True)
(workspace.path / "new.php").write_text("<?php\n")
summary = workspace.summary()
assert summary.files == ("new.php",)
assert summary.added_lines == 1