crypto: Test the loading of specific group sessions in the sqlite store.

master
Damir Jelić 2020-04-16 13:32:04 +02:00
parent 5b212a2fcd
commit 9444f1506d
1 changed files with 8 additions and 1 deletions

View File

@ -683,12 +683,19 @@ mod test {
let session_id = session.session_id().to_owned(); let session_id = session.session_id().to_owned();
store store
.save_inbound_group_session(session) .save_inbound_group_session(session.clone())
.await .await
.expect("Can't save group session"); .expect("Can't save group session");
let sessions = store.load_inbound_group_sessions().await.unwrap(); let sessions = store.load_inbound_group_sessions().await.unwrap();
assert_eq!(session_id, sessions[0].session_id()); assert_eq!(session_id, sessions[0].session_id());
let loaded_session = store
.get_inbound_group_session(&session.room_id, &session.sender_key, session.session_id())
.await
.unwrap()
.unwrap();
assert_eq!(session, loaded_session);
} }
} }