test_full_api.py•1.54 kB
import pytest
import pytest_asyncio
@pytest.mark.asyncio
async def test_full_api_availability(reaper_mcp_client):
"""Test that all ReaScript API methods are available"""
result = await reaper_mcp_client.list_tools()
tools = result.tools
tool_names = [tool.name for tool in tools]
# Check that we have a substantial number of tools
assert len(tool_names) >= 48, f"Expected 48+ tools, got {len(tool_names)}"
# Check some key methods exist
essential_methods = [
"get_track_count", "get_track", "set_track_name",
"add_media_item_to_track", "play", "stop",
"get_project_name", "save_project"
]
for method in essential_methods:
assert method in tool_names, f"Missing essential method: {method}"
@pytest.mark.asyncio
async def test_midi_workflow(reaper_mcp_client):
"""Test complete MIDI workflow"""
# Create track
result = await reaper_mcp_client.call_tool(
"insert_track",
{"index": 0, "use_defaults": True}
)
assert "Success" in result.content[0].text or "success" in result.content[0].text
# Set track name
result = await reaper_mcp_client.call_tool(
"set_track_name",
{"track_index": 0, "name": "Test MIDI Track"}
)
# Create MIDI item - skipped as MIDI tools not implemented yet
# result = await reaper_mcp_client.call_tool(
# "create_midi_item",
# {"track_index": 0, "start_time": 0.0, "end_time": 4.0}
# )
print(f"MIDI workflow test completed")