Skip to content

Commit 4c0c482

Browse files
committed
test: rename create_session_for to create_session_for_test_helper
To make it easier to see it's a test function when looking up callers/callees.
1 parent 13718c6 commit 4c0c482

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

crates/matrix-sdk-crypto/src/gossiping/machine.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,8 @@ mod tests {
12471247
.with_transaction(|mut btr| async {
12481248
let alice_account = atr.account().await?;
12491249
let bob_account = btr.account().await?;
1250-
let sessions = alice_account.create_session_for(bob_account).await;
1250+
let sessions =
1251+
alice_account.create_session_for_test_helper(bob_account).await;
12511252
Ok((btr, sessions))
12521253
})
12531254
.await?;
@@ -1845,7 +1846,7 @@ mod tests {
18451846
.with_transaction(|mut tr| async {
18461847
let alice_account = tr.account().await?;
18471848
let (alice_session, _) =
1848-
alice_account.create_session_for(&mut second_account).await;
1849+
alice_account.create_session_for_test_helper(&mut second_account).await;
18491850
Ok((tr, alice_session))
18501851
})
18511852
.await
@@ -2068,7 +2069,8 @@ mod tests {
20682069
.with_transaction(|mut btr| async {
20692070
let alice_account = atr.account().await?;
20702071
let bob_account = btr.account().await?;
2071-
let sessions = alice_account.create_session_for(bob_account).await;
2072+
let sessions =
2073+
alice_account.create_session_for_test_helper(bob_account).await;
20722074
Ok((btr, sessions))
20732075
})
20742076
.await?;

crates/matrix-sdk-crypto/src/olm/account.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,10 @@ impl Account {
980980
#[cfg(any(test, feature = "testing"))]
981981
#[allow(dead_code)]
982982
/// Testing only helper to create a session for the given Account
983-
pub async fn create_session_for(&mut self, other: &mut Account) -> (Session, Session) {
983+
pub async fn create_session_for_test_helper(
984+
&mut self,
985+
other: &mut Account,
986+
) -> (Session, Session) {
984987
use ruma::events::dummy::ToDeviceDummyEventContent;
985988

986989
other.generate_one_time_keys_helper(1);

crates/matrix-sdk-crypto/src/session_manager/sessions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ mod tests {
854854
.store
855855
.with_transaction(|mut tr| async {
856856
let manager_account = tr.account().await.unwrap();
857-
let res = bob.create_session_for(manager_account).await;
857+
let res = bob.create_session_for_test_helper(manager_account).await;
858858
Ok((tr, res))
859859
})
860860
.await

0 commit comments

Comments
 (0)