Skip to content

Commit 8abb6cd

Browse files
test: add empty command name validation test for project config
Adds a test case to verify that empty command names are rejected in project-level allowed_commands.yaml, matching the behavior already tested for org-level config. Updates test count to 163. Addresses review feedback from leonvanzyl. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fb0ebc6 commit 8abb6cd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test_security.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,21 @@ def test_project_commands():
453453
print(" FAIL: Non-allowed command 'rustc' should be blocked")
454454
failed += 1
455455

456+
# Test 4: Empty command name is rejected
457+
config_path.write_text("""version: 1
458+
commands:
459+
- name: ""
460+
description: Empty name should be rejected
461+
""")
462+
result = load_project_commands(project_dir)
463+
if result is None:
464+
print(" PASS: Empty command name rejected in project config")
465+
passed += 1
466+
else:
467+
print(" FAIL: Empty command name should be rejected in project config")
468+
print(f" Got: {result}")
469+
failed += 1
470+
456471
return passed, failed
457472

458473

0 commit comments

Comments
 (0)