()
| 199 | |
| 200 | #[tokio::test] |
| 201 | async fn test_web_fetch_invalid_url() { |
| 202 | let tool = WebFetchTool; |
| 203 | let ctx = ToolContext::new(std::path::PathBuf::from("/tmp")); |
| 204 | |
| 205 | let result = tool |
| 206 | .execute(&serde_json::json!({"url": "not-a-url"}), &ctx) |
| 207 | .await |
| 208 | .unwrap(); |
| 209 | |
| 210 | assert!(!result.success); |
| 211 | assert!(result.content.contains("must start with")); |
| 212 | } |
| 213 | |
| 214 | #[tokio::test] |
| 215 | async fn test_web_fetch_missing_url() { |