From 0a46eda5e894049d2c3c5aabc7898adbf94d552b Mon Sep 17 00:00:00 2001 From: cabana8471 Date: Tue, 27 Jan 2026 21:21:50 +0100 Subject: [PATCH] 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 --- test_security.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test_security.py b/test_security.py index e8576f2..d8cb256 100644 --- a/test_security.py +++ b/test_security.py @@ -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