@@ -312,7 +312,6 @@ Sent with my Delta Chat Messenger: https://delta.chat";
312
312
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
313
313
async fn test_should_encrypt ( ) -> Result < ( ) > {
314
314
let t = TestContext :: new_alice ( ) . await ;
315
- assert ! ( t. get_config_bool( Config :: E2eeEnabled ) . await ?) ;
316
315
let encrypt_helper = EncryptHelper :: new ( & t) . await . unwrap ( ) ;
317
316
318
317
let ps = new_peerstates ( EncryptPreference :: NoPreference ) ;
@@ -335,60 +334,6 @@ Sent with my Delta Chat Messenger: https://delta.chat";
335
334
Ok ( ( ) )
336
335
}
337
336
338
- // Tests that when encryption is not preferred, we encrypt anyway when we can.
339
- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
340
- async fn test_should_encrypt_e2ee_disabled ( ) -> Result < ( ) > {
341
- let t = & TestContext :: new_alice ( ) . await ;
342
- t. set_config_bool ( Config :: E2eeEnabled , false ) . await ?;
343
- let encrypt_helper = EncryptHelper :: new ( t) . await . unwrap ( ) ;
344
-
345
- let ps = new_peerstates ( EncryptPreference :: NoPreference ) ;
346
- assert ! ( encrypt_helper. should_encrypt( t, false , & ps) . await ?) ;
347
-
348
- let ps = new_peerstates ( EncryptPreference :: Reset ) ;
349
- assert ! ( encrypt_helper. should_encrypt( t, true , & ps) . await ?) ;
350
-
351
- let mut ps = new_peerstates ( EncryptPreference :: Mutual ) ;
352
- assert ! ( encrypt_helper. should_encrypt( t, false , & ps) . await ?) ;
353
-
354
- ps. push ( ps[ 0 ] . clone ( ) ) ;
355
- assert ! ( encrypt_helper. should_encrypt( t, false , & ps) . await ?) ;
356
-
357
- // Test with missing peerstate.
358
- let ps =
vec ! [ ( None , "[email protected] " . to_string
( ) ) ] ;
359
- assert ! ( encrypt_helper. should_encrypt( t, true , & ps) . await . is_err( ) ) ;
360
- Ok ( ( ) )
361
- }
362
-
363
- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
364
- async fn test_chatmail_prefers_to_encrypt ( ) -> Result < ( ) > {
365
- let mut tcm = TestContextManager :: new ( ) ;
366
- let alice = & tcm. alice ( ) . await ;
367
- let bob = & tcm. bob ( ) . await ;
368
- bob. set_config_bool ( Config :: IsChatmail , true ) . await ?;
369
-
370
- let bob_chat_id = tcm
371
- . send_recv_accept ( alice, bob, "Hello from DC" )
372
- . await
373
- . chat_id ;
374
- receive_imf (
375
- bob,
376
-
377
-
378
- Message-ID: <[email protected] >\n \
379
- Date: Sun, 22 Mar 3000 22:37:58 +0000\n \
380
- \n \
381
- Hello from another MUA\n ",
382
- false ,
383
- )
384
- . await ?;
385
- send_text_msg ( bob, bob_chat_id, "hi" . to_string ( ) ) . await ?;
386
- let sent_msg = bob. pop_sent_msg ( ) . await ;
387
- let msg = Message :: load_from_db ( bob, sent_msg. sender_msg_id ) . await ?;
388
- assert ! ( msg. get_showpadlock( ) ) ;
389
- Ok ( ( ) )
390
- }
391
-
392
337
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
393
338
async fn test_chatmail_can_send_unencrypted ( ) -> Result < ( ) > {
394
339
let mut tcm = TestContextManager :: new ( ) ;
0 commit comments