()
| 1080 | |
| 1081 | #[test] |
| 1082 | fn test_resolve_with_identity() { |
| 1083 | let dir = TempDir::new().unwrap(); |
| 1084 | |
| 1085 | // Create a mock identity store |
| 1086 | let config = r#" |
| 1087 | default_identity = "TESTID1234567890" |
| 1088 | version = 1 |
| 1089 | "#; |
| 1090 | fs::write(dir.path().join("config.toml"), config).unwrap(); |
| 1091 | |
| 1092 | // Create an identity directory |
| 1093 | let id_dir = dir.path().join("alice-personal"); |
| 1094 | fs::create_dir(&id_dir).unwrap(); |
| 1095 | let identity_toml = r#" |
| 1096 | id = "TESTID1234567890" |
| 1097 | name = "Alice" |
| 1098 | email = "alice@example.com" |
| 1099 | public_key = "PK_BASE32_ALICE" |
| 1100 | identity_type = "user" |
| 1101 | "#; |
| 1102 | fs::write(id_dir.join("identity.toml"), identity_toml).unwrap(); |
| 1103 | |
| 1104 | let options = AgentAuthorOptions { |
| 1105 | agent_name: "claude-code", |
| 1106 | agent_display_name: "Claude Code", |
| 1107 | session_id: "60f5cbd2-aa23-40ee-9085-4375dd186ce7", |
| 1108 | identity_dir: Some(dir.path().to_path_buf()), |
| 1109 | agent_identity: None, |
| 1110 | }; |
| 1111 | |
| 1112 | let author = resolve_agent_author(&options); |
| 1113 | |
| 1114 | assert_eq!(author.name, "claude+60f5"); |
| 1115 | assert_eq!(author.email, Some("alice@example.com".to_string())); |
| 1116 | assert_eq!(author.identity, Some("PK_BASE32_ALICE".to_string())); |
| 1117 | } |
| 1118 | |
| 1119 | #[test] |
| 1120 | fn test_resolve_with_identity_no_email() { |
nothing calls this directly
no test coverage detected