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>
This commit is contained in:
cabana8471
2026-01-27 21:21:50 +01:00
parent 06c0bf4fd3
commit 0a46eda5e8

View File

@@ -455,6 +455,21 @@ commands:
print(" FAIL: Non-allowed command 'rustc' should be blocked")
failed += 1
# Test 4: Empty command name is rejected
config_path.write_text("""version: 1
commands:
- name: ""
description: Empty name should be rejected
""")
result = load_project_commands(project_dir)
if result is None:
print(" PASS: Empty command name rejected in project config")
passed += 1
else:
print(" FAIL: Empty command name should be rejected in project config")
print(f" Got: {result}")
failed += 1
return passed, failed