enhanced-mcp-tools/tests/test_basic.py
Ryan Malloy 92b158b847
Some checks failed
CI / Code Quality (push) Failing after 17s
CI / Test (ubuntu-latest, 3.10) (push) Failing after 5s
CI / Test (ubuntu-latest, 3.11) (push) Failing after 4s
CI / Test (ubuntu-latest, 3.12) (push) Failing after 4s
CI / Test (ubuntu-latest, 3.13) (push) Failing after 4s
CI / Coverage (push) Failing after 25s
CI / Test (macos-latest, 3.13) (push) Has been cancelled
CI / Test (macos-latest, 3.10) (push) Has been cancelled
CI / Test (macos-latest, 3.11) (push) Has been cancelled
CI / Test (macos-latest, 3.12) (push) Has been cancelled
CI / Test (windows-latest, 3.10) (push) Has been cancelled
CI / Test (windows-latest, 3.11) (push) Has been cancelled
CI / Test (windows-latest, 3.12) (push) Has been cancelled
CI / Test (windows-latest, 3.13) (push) Has been cancelled
🚀 Initial release: Enhanced MCP Tools v1.0.0
 Features:
- 50+ development tools across 13 specialized categories
-  Sneller Analytics: High-performance vectorized SQL (TB/s throughput)
- 🎬 Asciinema Integration: Terminal recording and sharing
- 🧠 AI-Powered Recommendations: Intelligent tool suggestions
- 🔀 Advanced Git Integration: Smart operations with AI suggestions
- 📁 Enhanced File Operations: Monitoring, bulk ops, backups
- 🔍 Semantic Code Search: AST-based intelligent analysis
- 🏗️ Development Workflow: Testing, linting, formatting
- 🌐 Network & API Tools: HTTP client, mock servers
- 📦 Archive & Compression: Multi-format operations
- 🔬 Process Tracing: System call monitoring
- 🌍 Environment Management: Virtual envs, dependencies

🎯 Ready for production with comprehensive documentation and MCP Inspector support!
2025-06-23 02:33:23 -06:00

65 lines
1.8 KiB
Python

"""
Basic tests for the MCP server tools.
Run with: pytest tests/test_basic.py
"""
import os
import tempfile
from pathlib import Path
import pytest
# Import the implementations from enhanced_mcp
from enhanced_mcp.diff_patch import DiffPatchOperations
from enhanced_mcp.file_operations import EnhancedFileOperations
from enhanced_mcp.git_integration import GitIntegration
class TestFileOperations:
"""Test file operation tools"""
@pytest.mark.asyncio
async def test_file_backup_simple(self):
"""Test simple file backup"""
with tempfile.TemporaryDirectory() as tmp_dir:
# Create test file
test_file = Path(tmp_dir) / "test.txt"
test_file.write_text("Test content")
backup_dir = Path(tmp_dir) / "backups"
# Perform backup
file_tools = ExampleFileOperations()
backups = await file_tools.file_backup(
[str(test_file)], backup_directory=str(backup_dir)
)
# Verify backup created
assert len(backups) == 1
assert os.path.exists(backups[0])
# Verify content preserved
with open(backups[0]) as f:
assert f.read() == "Test content"
class TestSearchAnalysis:
"""Test search and analysis tools"""
@pytest.mark.asyncio
async def test_project_stats_resource(self):
"""Test project statistics resource"""
# Use the current project directory
search_tools = ExampleSearchAnalysis()
stats = await search_tools.get_project_stats(".")
# Verify basic structure
assert "total_files" in stats
assert "total_lines" in stats
assert "file_types" in stats
assert stats["total_files"] > 0
if __name__ == "__main__":
pytest.main([__file__, "-v"])