1
0
Fork 0
mirror of https://gitlab.com/hagrid-keyserver/hagrid.git synced 2023-02-13 20:55:02 -05:00

database: test publish with bad uid

This commit is contained in:
Vincent Breitmoser 2019-06-13 17:57:30 +02:00
parent 9b3f4f6405
commit 25c9b40a1d
No known key found for this signature in database
GPG key ID: 7BD18320DEADFA11

View file

@ -910,6 +910,7 @@ pub fn test_bad_uids<D: Database>(db: &mut D) {
.generate()
.unwrap()
.0;
let fpr = Fingerprint::try_from(tpk.fingerprint()).unwrap();
let email2 = Email::from_str(str_uid2).unwrap();
let tpk_status = db.merge(tpk).unwrap().into_tpk_status();
@ -920,6 +921,17 @@ pub fn test_bad_uids<D: Database>(db: &mut D) {
),
unparsed_uids: 2,
}, tpk_status);
db.set_email_published(&fpr, &email2).unwrap();
let tpk_status = db.get_tpk_status(&fpr, &vec!(email2.clone())).unwrap();
assert_eq!(TpkStatus {
is_revoked: false,
email_status: vec!(
(email2.clone(), EmailAddressStatus::Published),
),
unparsed_uids: 2,
}, tpk_status);
}
pub fn test_no_selfsig<D: Database>(db: &mut D) {