mcp / test_clean_app.py
Tracy André
updated
1bfbe17
raw
history blame
1.53 kB
"""
Test de l'application après suppression des fonctions safe_*
"""
import os
from mcp_server import create_mcp_interface
# Hugging Face configuration
hf_token = os.environ.get("HF_TOKEN")
if hf_token:
os.environ["HF_TOKEN"] = hf_token
os.environ["DATASET_ID"] = "HackathonCRA/2024"
def test_clean_app():
"""Test de l'application après nettoyage"""
print("🧪 Test de l'application après suppression des fonctions safe_*...")
try:
demo = create_mcp_interface()
print("✅ Interface créée avec succès")
# Test des resources MCP
from mcp_server import (
get_available_plots_resource,
get_dataset_info,
get_plot_info,
list_mcp_resources
)
print("\n📋 Test des resources MCP:")
print("Plots:", get_available_plots_resource()[:100] + "...")
print("Dataset:", get_dataset_info()[:100] + "...")
print("Plot info:", get_plot_info("Champ ferme W du sol")[:100] + "...")
print("\n🎯 Application nettoyée et fonctionnelle !")
print("📋 5 onglets disponibles")
print("🔧 12 resources MCP avec @gr.mcp.resource")
print("✅ Fonctions safe_* supprimées")
print("🚀 Prêt pour déploiement")
return True
except Exception as e:
print(f"❌ Erreur: {e}")
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
test_clean_app()