mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
Unify some testing interfaces
This tidies up our testing tools a little bit. We had several functions which through various changes ended up doing the same and some more which did very similar stuff, so I merged them to have things simpler. Also moved towards methods on the TestContext struct while cleaning this up anyway, seems like this structure is going to stay around for a bit anyway. The intersting change is in `test_utils.rs`, everything else is just updating callers. A few tests used example.org which I moved to example.com to be able to re-use more configuration of the test context.
This commit is contained in:
@@ -473,7 +473,7 @@ mod tests {
|
||||
|
||||
#[async_std::test]
|
||||
async fn test_peerstate_save_to_db() {
|
||||
let ctx = crate::test_utils::dummy_context().await;
|
||||
let ctx = crate::test_utils::TestContext::new().await;
|
||||
let addr = "hello@mail.com";
|
||||
|
||||
let pub_key = alice_keypair().public;
|
||||
@@ -516,7 +516,7 @@ mod tests {
|
||||
|
||||
#[async_std::test]
|
||||
async fn test_peerstate_double_create() {
|
||||
let ctx = crate::test_utils::dummy_context().await;
|
||||
let ctx = crate::test_utils::TestContext::new().await;
|
||||
let addr = "hello@mail.com";
|
||||
let pub_key = alice_keypair().public;
|
||||
|
||||
@@ -549,7 +549,7 @@ mod tests {
|
||||
|
||||
#[async_std::test]
|
||||
async fn test_peerstate_with_empty_gossip_key_save_to_db() {
|
||||
let ctx = crate::test_utils::dummy_context().await;
|
||||
let ctx = crate::test_utils::TestContext::new().await;
|
||||
let addr = "hello@mail.com";
|
||||
|
||||
let pub_key = alice_keypair().public;
|
||||
|
||||
Reference in New Issue
Block a user