GRM-58: fix: enforce commit message convention on master with CI validation
This commit is contained in:
@@ -128,6 +128,29 @@ class TestMain:
|
||||
result = runner.invoke(main, [])
|
||||
assert result.exit_code == 2
|
||||
|
||||
def test_branch_override_accepts_master_commit(self) -> None:
|
||||
"""--branch master overrides branch detection (for CI use)."""
|
||||
msg_path = self._write_msg("GRM-19: feat: add feature")
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(main, [msg_path, "--branch", "master"])
|
||||
assert result.exit_code == 0
|
||||
|
||||
def test_branch_override_rejects_missing_task_id(self) -> None:
|
||||
"""--branch master still enforces GRM-N: prefix."""
|
||||
msg_path = self._write_msg("feat: add feature")
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(main, [msg_path, "--branch", "master"])
|
||||
assert result.exit_code == 1
|
||||
assert "task ID" in result.output
|
||||
|
||||
def test_branch_override_feature_accepts_conventional(self) -> None:
|
||||
"""--branch feature still rejects GRM-N prefix."""
|
||||
msg_path = self._write_msg("GRM-19: feat: add feature")
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(main, [msg_path, "--branch", "feature"])
|
||||
assert result.exit_code == 1
|
||||
assert "task ID" in result.output
|
||||
|
||||
|
||||
def test_main_module_block() -> None:
|
||||
import tempfile
|
||||
|
||||
Reference in New Issue
Block a user