29 lines
823 B
Python
29 lines
823 B
Python
from gitea_codex_bot.services.commands import parse_command
|
|
|
|
|
|
def test_parse_review_command_modes() -> None:
|
|
cmd = parse_command("@codex review security --full")
|
|
assert cmd is not None
|
|
assert cmd.name == "review"
|
|
assert cmd.mode == "security"
|
|
assert cmd.full is True
|
|
assert cmd.mode_explicit is True
|
|
|
|
|
|
def test_parse_review_command_defaults_to_non_explicit_summary_mode() -> None:
|
|
cmd = parse_command("@codex review")
|
|
assert cmd is not None
|
|
assert cmd.mode == "summary"
|
|
assert cmd.mode_explicit is False
|
|
|
|
|
|
def test_parse_fix_branch() -> None:
|
|
cmd = parse_command("@codex fix --branch finding 2")
|
|
assert cmd is not None
|
|
assert cmd.name == "fix"
|
|
assert cmd.branch_fix is True
|
|
|
|
|
|
def test_invalid_command_returns_none() -> None:
|
|
assert parse_command("hello") is None
|