mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
adapt the protected-header test; protected-headers really require encryption now and parts of the tests are know to fail now. however, protected-headers are also tested in python implicitly in several places
This commit is contained in:
committed by
holger krekel
parent
36fc2c83f2
commit
29866092de
@@ -1121,21 +1121,24 @@ mod tests {
|
|||||||
--==break==--\n\
|
--==break==--\n\
|
||||||
\n\
|
\n\
|
||||||
\x00";
|
\x00";
|
||||||
|
|
||||||
let mimeparser = MimeParser::from_bytes(&context.ctx, &raw[..]).unwrap();
|
let mimeparser = MimeParser::from_bytes(&context.ctx, &raw[..]).unwrap();
|
||||||
|
|
||||||
// test that we treat Subject as a protected header that can
|
// non-overwritten headers do not bubble up
|
||||||
// bubble upwards
|
|
||||||
assert_eq!(mimeparser.get_subject(), Some("inner-subject".into()));
|
|
||||||
|
|
||||||
let of = mimeparser.get(HeaderDef::SecureJoinGroup).unwrap();
|
let of = mimeparser.get(HeaderDef::SecureJoinGroup).unwrap();
|
||||||
assert_eq!(of, "no");
|
assert_eq!(of, "no");
|
||||||
|
|
||||||
// unprotected headers do not bubble upwards
|
// unknown headers do not bubble upwards
|
||||||
let of = mimeparser.get(HeaderDef::_TestHeader).unwrap();
|
let of = mimeparser.get(HeaderDef::_TestHeader).unwrap();
|
||||||
assert_eq!(of, "Bar");
|
assert_eq!(of, "Bar");
|
||||||
|
|
||||||
|
// the following fields would bubble up
|
||||||
|
// if the test would really use encryption for the protected part
|
||||||
|
// however, as this is not the case, the outer things stay valid
|
||||||
|
assert_eq!(mimeparser.get_subject(), Some("outer-subject".into()));
|
||||||
|
|
||||||
let of = mimeparser.get(HeaderDef::ChatVersion).unwrap();
|
let of = mimeparser.get(HeaderDef::ChatVersion).unwrap();
|
||||||
assert_eq!(of, "1.0");
|
assert_eq!(of, "0.0");
|
||||||
assert_eq!(mimeparser.parts.len(), 1);
|
assert_eq!(mimeparser.parts.len(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user