Remove redundant key_id arg on create_session test helper

This commit is contained in:
Richard van der Hoff
2023-10-31 17:26:12 +00:00
committed by Damir Jelić
parent 303417eae2
commit d48c27dc86
2 changed files with 5 additions and 9 deletions

View File

@@ -491,7 +491,7 @@ mod tests {
.await
.expect("We should be able to create a request to upload a dehydrated device");
let (key_id, one_time_key) = request
let (_key_id, one_time_key) = request
.one_time_keys
.pop_first()
.expect("The dehydrated device creation request should contain a one-time key");
@@ -499,7 +499,7 @@ mod tests {
// Ensure that we know about the public keys of the dehydrated device.
receive_device_keys(&alice, user_id(), &request.device_id, request.device_keys).await;
// Create a 1-to-1 Olm session with the dehydrated device.
create_session(&alice, user_id(), &request.device_id, key_id, one_time_key).await;
create_session(&alice, user_id(), &request.device_id, one_time_key).await;
// Send a room key to the dehydrated device.
let (event, group_session) = send_room_key(&alice, room_id, user_id()).await;

View File

@@ -2622,7 +2622,6 @@ pub(crate) mod tests {
machine: &OlmMachine,
user_id: &UserId,
device_id: &DeviceId,
_key_id: OwnedDeviceKeyId,
one_time_key: Raw<OneTimeKey>,
) {
let keys = BTreeMap::from([(device_id.to_owned(), &one_time_key)]);
@@ -2634,13 +2633,12 @@ pub(crate) mod tests {
async fn test_session_creation() {
let (alice_machine, bob_machine, mut one_time_keys) =
get_machine_pair(alice_id(), user_id(), false).await;
let (device_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
let (_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
create_session(
&alice_machine,
bob_machine.user_id(),
bob_machine.device_id(),
device_key_id,
one_time_key,
)
.await;
@@ -2661,7 +2659,7 @@ pub(crate) mod tests {
async fn test_getting_most_recent_session() {
let (alice_machine, bob_machine, mut one_time_keys) =
get_machine_pair(alice_id(), user_id(), false).await;
let (device_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
let (_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
let device = alice_machine
.get_device(bob_machine.user_id(), bob_machine.device_id(), None)
@@ -2675,19 +2673,17 @@ pub(crate) mod tests {
&alice_machine,
bob_machine.user_id(),
bob_machine.device_id(),
device_key_id,
one_time_key.to_owned(),
)
.await;
for _ in 0..10 {
let (device_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
let (_key_id, one_time_key) = one_time_keys.pop_first().unwrap();
create_session(
&alice_machine,
bob_machine.user_id(),
bob_machine.device_id(),
device_key_id,
one_time_key.to_owned(),
)
.await;