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

Function test_get_active_mut

crates/chat-cli/src/cli/agent/mod.rs:1082–1098  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1080
1081 #[test]
1082 fn test_get_active_mut() {
1083 let mut collection = Agents::default();
1084 assert!(collection.get_active_mut().is_none());
1085
1086 let agent = Agent::default();
1087 collection.agents.insert("default".to_string(), agent);
1088 collection.active_idx = "default".to_string();
1089
1090 assert!(collection.get_active_mut().is_some());
1091 let active = collection.get_active_mut().unwrap();
1092 active.description = Some("Modified description".to_string());
1093
1094 assert_eq!(
1095 collection.agents.get("default").unwrap().description,
1096 Some("Modified description".to_string())
1097 );
1098 }
1099
1100 #[test]
1101 fn test_switch() {

Callers

nothing calls this directly

Calls 3

insertMethod · 0.80
to_stringMethod · 0.80
get_active_mutMethod · 0.80

Tested by

no test coverage detected