feat(mma): Add dependency mapping to mma-exec

This commit is contained in:
2026-02-25 20:12:14 -05:00
parent 4e564aad79
commit 32ec14f5c3
2 changed files with 34 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import pytest
from unittest.mock import patch, MagicMock
from scripts.mma_exec import create_parser, get_role_documents, execute_agent, get_model_for_role
from scripts.mma_exec import create_parser, get_role_documents, execute_agent, get_model_for_role, get_dependencies
def test_parser_role_choices():
"""Test that the parser accepts valid roles and the prompt argument."""
@@ -83,4 +83,16 @@ def test_execute_agent():
assert kwargs.get("capture_output") is True
assert kwargs.get("text") is True
assert result == mock_stdout
assert result == mock_stdout
def test_get_dependencies(tmp_path):
content = (
"import os\n"
"import sys\n"
"import file_cache\n"
"from mcp_client import something\n"
)
filepath = tmp_path / "mock_script.py"
filepath.write_text(content)
dependencies = get_dependencies(filepath)
assert dependencies == ['os', 'sys', 'file_cache', 'mcp_client']