|
2 | 2 | //! Comprehensive tests for AI planning and tool calling functionality |
3 | 3 |
|
4 | 4 | use anyhow::Result; |
5 | | -use mockito::{Mock, Server}; |
6 | | -use osvm::services::ai_service::{AiService, PlannedTool, ToolPlan}; |
7 | | -use osvm::services::mcp_service::{McpService, McpTool}; |
| 5 | +use mockito::Server; |
| 6 | +use osvm::services::ai_service::AiService; |
| 7 | +use osvm::services::mcp_service::McpTool; |
8 | 8 | use serde_json::json; |
9 | 9 | use std::collections::HashMap; |
10 | 10 |
|
@@ -82,7 +82,6 @@ fn create_sample_tools() -> HashMap<String, Vec<McpTool>> { |
82 | 82 | #[cfg(all(test, feature = "incomplete_tests"))] |
83 | 83 | mod tests { |
84 | 84 | use super::*; |
85 | | - use tokio; |
86 | 85 |
|
87 | 86 | #[cfg(feature = "incomplete_tests")] |
88 | 87 | #[tokio::test] |
@@ -332,39 +331,39 @@ mod tests { |
332 | 331 | } |
333 | 332 | } |
334 | 333 |
|
335 | | -#[cfg(all(test, feature = "incomplete_tests"))] |
336 | | -#[cfg(feature = "proptest")] // Disabled: proptest not in dependencies |
337 | | -mod property_tests { |
338 | | - use super::*; |
339 | | - // use proptest::prelude::*; |
340 | | - |
341 | | - // proptest! { |
342 | | - // #[test] |
343 | | - // fn test_tool_plan_serialization_roundtrip( |
344 | | - // reasoning in "[a-zA-Z ]{10,100}", |
345 | | - // outcome in "[a-zA-Z ]{10,100}", |
346 | | - // num_tools in 0usize..5 |
347 | | - // ) { |
348 | | - // let tools: Vec<PlannedTool> = (0..num_tools) |
349 | | - // .map(|i| PlannedTool { |
350 | | - // server_id: format!("server-{}", i), |
351 | | - // tool_name: format!("tool-{}", i), |
352 | | - // args: json!({}), |
353 | | - // }) |
354 | | - // .collect(); |
355 | | - |
356 | | - // let plan = ToolPlan { |
357 | | - // reasoning: reasoning.clone(), |
358 | | - // osvm_tools_to_use: tools, |
359 | | - // expected_outcome: outcome.clone(), |
360 | | - // }; |
361 | | - |
362 | | - // let serialized = serde_json::to_string(&plan).unwrap(); |
363 | | - // let deserialized: ToolPlan = serde_json::from_str(&serialized).unwrap(); |
364 | | - |
365 | | - // assert_eq!(plan.reasoning, deserialized.reasoning); |
366 | | - // assert_eq!(plan.expected_outcome, deserialized.expected_outcome); |
367 | | - // assert_eq!(plan.osvm_tools_to_use.len(), deserialized.osvm_tools_to_use.len()); |
368 | | - // } |
369 | | - // } |
370 | | -} |
| 334 | +// Disabled: proptest not in dependencies |
| 335 | +// #[cfg(all(test, feature = "incomplete_tests"))] |
| 336 | +// mod property_tests { |
| 337 | +// use super::*; |
| 338 | +// // use proptest::prelude::*; |
| 339 | +// |
| 340 | +// // proptest! { |
| 341 | +// // #[test] |
| 342 | +// // fn test_tool_plan_serialization_roundtrip( |
| 343 | +// // reasoning in "[a-zA-Z ]{10,100}", |
| 344 | +// // outcome in "[a-zA-Z ]{10,100}", |
| 345 | +// // num_tools in 0usize..5 |
| 346 | +// // ) { |
| 347 | +// // let tools: Vec<PlannedTool> = (0..num_tools) |
| 348 | +// // .map(|i| PlannedTool { |
| 349 | +// // server_id: format!("server-{}", i), |
| 350 | +// // tool_name: format!("tool-{}", i), |
| 351 | +// // args: json!({}), |
| 352 | +// // }) |
| 353 | +// // .collect(); |
| 354 | +// |
| 355 | +// // let plan = ToolPlan { |
| 356 | +// // reasoning: reasoning.clone(), |
| 357 | +// // osvm_tools_to_use: tools, |
| 358 | +// // expected_outcome: outcome.clone(), |
| 359 | +// // }; |
| 360 | +// |
| 361 | +// // let serialized = serde_json::to_string(&plan).unwrap(); |
| 362 | +// // let deserialized: ToolPlan = serde_json::from_str(&serialized).unwrap(); |
| 363 | +// |
| 364 | +// // assert_eq!(plan.reasoning, deserialized.reasoning); |
| 365 | +// // assert_eq!(plan.expected_outcome, deserialized.expected_outcome); |
| 366 | +// // assert_eq!(plan.osvm_tools_to_use.len(), deserialized.osvm_tools_to_use.len()); |
| 367 | +// // } |
| 368 | +// // } |
| 369 | +// } |
0 commit comments