feat: first commit

This commit is contained in:
Neeraj Nigam
2026-03-18 21:23:14 -05:00
commit 0b1ec4a818
25 changed files with 3068 additions and 0 deletions

40
tests/test_cli.py Normal file
View File

@@ -0,0 +1,40 @@
"""Unit tests for --workdir CLI argument handling."""
import subprocess
import sys
from pathlib import Path
class TestWorkdirCLI:
def test_missing_workdir_argument(self):
"""CLI should exit with error when --workdir is not provided."""
result = subprocess.run(
[sys.executable, "main.py"],
capture_output=True,
text=True,
)
assert result.returncode != 0
assert "--workdir argument is required" in result.stderr
def test_nonexistent_workdir(self, tmp_path):
"""CLI should exit with error when --workdir path doesn't exist."""
nonexistent = tmp_path / "does_not_exist"
result = subprocess.run(
[sys.executable, "main.py", "--workdir", str(nonexistent)],
capture_output=True,
text=True,
)
assert result.returncode != 0
assert "Workdir does not exist" in result.stderr
def test_workdir_is_file_not_directory(self, tmp_path):
"""CLI should exit with error when --workdir is a file, not a directory."""
file_path = tmp_path / "afile.txt"
file_path.write_text("I am a file")
result = subprocess.run(
[sys.executable, "main.py", "--workdir", str(file_path)],
capture_output=True,
text=True,
)
assert result.returncode != 0
assert "Workdir is not a directory" in result.stderr