events: Make some test assertions more helpful

This commit is contained in:
Kévin Commaille 2022-06-11 22:35:52 +02:00 committed by Kévin Commaille
parent a47c8f08d3
commit 0384035c48
3 changed files with 5 additions and 8 deletions

View File

@ -87,9 +87,6 @@ mod tests {
} }
}); });
assert!(from_json_value::<Raw<OriginalPolicyRuleRoomEvent>>(json) from_json_value::<Raw<OriginalPolicyRuleRoomEvent>>(json).unwrap().deserialize().unwrap();
.unwrap()
.deserialize()
.is_ok());
} }
} }

View File

@ -235,6 +235,6 @@ mod tests {
"type": "m.push_rules" "type": "m.push_rules"
}); });
assert!(from_json_value::<PushRulesEvent>(json_data).is_ok()); from_json_value::<PushRulesEvent>(json_data).unwrap();
} }
} }

View File

@ -411,11 +411,11 @@ mod tests {
#[test] #[test]
fn deserialization_failure() { fn deserialization_failure() {
assert!(from_json_value::<Raw<RoomEncryptedEventContent>>( from_json_value::<Raw<RoomEncryptedEventContent>>(
json!({ "algorithm": "m.megolm.v1.aes-sha2" }) json!({ "algorithm": "m.megolm.v1.aes-sha2" }),
) )
.unwrap() .unwrap()
.deserialize() .deserialize()
.is_err()); .unwrap_err();
} }
} }