From 0b2cd324e589ae9a968d4c179666a10d61faf607 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 25 Feb 2026 19:09:14 -0500 Subject: [PATCH] feat(mma): Scaffold mma_exec.py with basic CLI structure --- scripts/mma_exec.py | 25 +++++++++++++++++++++++++ tests/test_mma_exec.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 scripts/mma_exec.py create mode 100644 tests/test_mma_exec.py diff --git a/scripts/mma_exec.py b/scripts/mma_exec.py new file mode 100644 index 0000000..af40245 --- /dev/null +++ b/scripts/mma_exec.py @@ -0,0 +1,25 @@ +import argparse + +def create_parser(): + parser = argparse.ArgumentParser(description="MMA Execution Script") + parser.add_argument( + "--role", + choices=['tier1', 'tier2', 'tier3', 'tier4'], + required=True, + help="The tier role to execute" + ) + parser.add_argument( + "prompt", + type=str, + help="The prompt for the tier" + ) + return parser + +def main(): + parser = create_parser() + args = parser.parse_args() + print(f"Role: {args.role}") + print(f"Prompt: {args.prompt}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tests/test_mma_exec.py b/tests/test_mma_exec.py new file mode 100644 index 0000000..fda0899 --- /dev/null +++ b/tests/test_mma_exec.py @@ -0,0 +1,32 @@ +import pytest +from scripts.mma_exec import create_parser + +def test_parser_role_choices(): + """Test that the parser accepts valid roles and the prompt argument.""" + parser = create_parser() + valid_roles = ['tier1', 'tier2', 'tier3', 'tier4'] + test_prompt = "Analyze the codebase for bottlenecks." + + for role in valid_roles: + args = parser.parse_args(['--role', role, test_prompt]) + assert args.role == role + assert args.prompt == test_prompt + +def test_parser_invalid_role(): + """Test that the parser rejects roles outside the specified choices.""" + parser = create_parser() + with pytest.raises(SystemExit): + parser.parse_args(['--role', 'tier5', 'Some prompt']) + +def test_parser_prompt_required(): + """Test that the prompt argument is mandatory.""" + parser = create_parser() + with pytest.raises(SystemExit): + parser.parse_args(['--role', 'tier3']) + +def test_parser_help(): + """Test that the help flag works without raising errors (exits with 0).""" + parser = create_parser() + with pytest.raises(SystemExit) as excinfo: + parser.parse_args(['--help']) + assert excinfo.value.code == 0 \ No newline at end of file