MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / test_aws_output

Function test_aws_output

crates/chat-cli/src/cli/chat/tools/use_aws.rs:315–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313 #[tokio::test]
314 #[ignore = "not in ci"]
315 async fn test_aws_output() {
316 let os = Os::new().await.unwrap();
317
318 let v = serde_json::json!({
319 "service_name": "s3",
320 "operation_name": "ls",
321 "parameters": {},
322 "region": "us-west-2",
323 "profile_name": "default",
324 "label": ""
325 });
326 let out = serde_json::from_value::<UseAws>(v)
327 .unwrap()
328 .invoke(&os, &mut std::io::stdout())
329 .await
330 .unwrap();
331
332 if let OutputKind::Json(json) = out.output {
333 // depending on where the test is ran we might get different outcome here but it does
334 // not mean the tool is not working
335 let exit_status = json.get("exit_status").unwrap();
336 if exit_status == 0 {
337 assert_eq!(json.get("stderr").unwrap(), "");
338 } else {
339 assert_ne!(json.get("stderr").unwrap(), "");
340 }
341 } else {
342 panic!("Expected JSON output");
343 }
344 }
345
346 #[tokio::test]
347 async fn test_eval_perm() {

Callers

nothing calls this directly

Calls 2

invokeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected