MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_resolve_with_identity_no_email

Function test_resolve_with_identity_no_email

atomic-agent/src/identity.rs:652–680  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

650
651 #[test]
652 fn test_resolve_with_identity_no_email() {
653 let dir = TempDir::new().unwrap();
654
655 let config = r#"default_identity = "NOEMAIL_ID""#;
656 fs::write(dir.path().join("config.toml"), config).unwrap();
657
658 let id_dir = dir.path().join("bob-agent");
659 fs::create_dir(&id_dir).unwrap();
660 let identity_toml = r#"
661id = "NOEMAIL_ID"
662name = "Bob"
663public_key = "PK_BOB"
664identity_type = "user"
665"#;
666 fs::write(id_dir.join("identity.toml"), identity_toml).unwrap();
667
668 let options = AgentAuthorOptions {
669 agent_name: "gemini-cli",
670 agent_display_name: "Gemini CLI",
671 session_id: "abcdef12",
672 identity_dir: Some(dir.path().to_path_buf()),
673 };
674
675 let author = resolve_agent_author(&options);
676
677 assert_eq!(author.name, "gemini+abcd");
678 assert!(author.email.is_none());
679 assert_eq!(author.identity, Some("PK_BOB".to_string()));
680 }
681
682 // build_agent_author (convenience function)
683

Callers

nothing calls this directly

Calls 4

writeFunction · 0.85
resolve_agent_authorFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected