mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Add stricter assertions to whoami test
This commit is contained in:
parent
4ba9508a31
commit
3c774dcf6c
|
@ -120,10 +120,12 @@ fn test_server_whoami_anonymous() {
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
|
|
||||||
// Now do a whoami.
|
// Now do a whoami.
|
||||||
let post_res = rsclient.whoami().unwrap();
|
let (_e, uat) = match rsclient.whoami().unwrap() {
|
||||||
assert!(post_res.is_some());
|
Some((e, uat)) => (e, uat),
|
||||||
// TODO: Now unwrap and ensure anony
|
None => panic!(),
|
||||||
println!("{:?}", post_res);
|
};
|
||||||
|
debug!("{}", uat);
|
||||||
|
assert!(uat.name == "anonymous");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,10 +141,12 @@ fn test_server_whoami_admin_simple_password() {
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
|
|
||||||
// Now do a whoami.
|
// Now do a whoami.
|
||||||
let post_res = rsclient.whoami().unwrap();
|
let (_e, uat) = match rsclient.whoami().unwrap() {
|
||||||
assert!(post_res.is_some());
|
Some((e, uat)) => (e, uat),
|
||||||
// TODO: Now unwrap and ensure anony
|
None => panic!(),
|
||||||
debug!("{:?}", post_res);
|
};
|
||||||
|
debug!("{}", uat);
|
||||||
|
assert!(uat.name == "admin");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue