Spaces:
Sleeping
Sleeping
| """ | |
| Test des resources MCP | |
| """ | |
| from mcp_server import ( | |
| get_available_plots_resource, | |
| get_available_crops_resource, | |
| get_available_years_resource, | |
| get_dataset_info, | |
| get_plot_info, | |
| get_crop_info, | |
| get_year_summary, | |
| get_herbicide_usage_summary, | |
| get_predictions_summary, | |
| get_recommendations_summary, | |
| get_plot_predictions | |
| ) | |
| def test_mcp_resources(): | |
| """Test des resources MCP""" | |
| print("🧪 Test des resources MCP...") | |
| # Test resources statiques | |
| print("\n📋 Test resources statiques:") | |
| print("Plots:", get_available_plots_resource()) | |
| print("Crops:", get_available_crops_resource()) | |
| print("Years:", get_available_years_resource()) | |
| print("Dataset info:", get_dataset_info()[:200] + "...") | |
| # Test resources avec paramètres | |
| print("\n🏞️ Test resources avec paramètres:") | |
| print("Plot info:", get_plot_info("Champ ferme W du sol")[:200] + "...") | |
| print("Crop info:", get_crop_info("blé tendre hiver")[:200] + "...") | |
| print("Year summary:", get_year_summary(2023)[:200] + "...") | |
| # Test resources d'analyse | |
| print("\n📊 Test resources d'analyse:") | |
| print("Herbicide usage:", get_herbicide_usage_summary()[:200] + "...") | |
| print("Predictions:", get_predictions_summary()[:200] + "...") | |
| print("Recommendations:", get_recommendations_summary()[:200] + "...") | |
| # Test resource prédictions par parcelle | |
| print("\n🔮 Test prédictions par parcelle:") | |
| print("Plot predictions:", get_plot_predictions("Champ ferme W du sol")[:200] + "...") | |
| if __name__ == "__main__": | |
| test_mcp_resources() | |