MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_agent_simple_response

Function test_agent_simple_response

core/src/agent/tests.rs:386–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

384
385#[tokio::test]
386async fn test_agent_simple_response() {
387 let mock_client = Arc::new(MockLlmClient::new(vec![MockLlmClient::text_response(
388 "Hello, I'm an AI assistant.",
389 )]));
390
391 let tool_executor = Arc::new(ToolExecutor::new("/tmp".to_string()));
392 let config = AgentConfig::default();
393
394 let agent = AgentLoop::new(
395 mock_client.clone(),
396 tool_executor,
397 test_tool_context(),
398 config,
399 );
400 let result = agent.execute(&[], "Hello", None).await.unwrap();
401
402 assert_eq!(result.text, "Hello, I'm an AI assistant.");
403 assert_eq!(result.tool_calls_count, 0);
404 assert_eq!(mock_client.call_count.load(Ordering::SeqCst), 1);
405}
406
407#[tokio::test]
408async fn test_agent_with_tool_call() {

Callers

nothing calls this directly

Calls 3

test_tool_contextFunction · 0.70
cloneMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected