Skip to content

Commit 4186d78

Browse files
committed
test: add python test for message forwarding from encrypted to unencrypted chat
1 parent 06cccb7 commit 4186d78

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

python/tests/test_1_online.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,30 @@ def test_forward_messages(acfactory, lp):
498498
assert not chat3.get_messages()
499499

500500

501+
def test_forward_encrypted_to_unencrypted(acfactory, lp):
502+
ac1, ac2, ac3 = acfactory.get_online_accounts(3)
503+
chat = acfactory.get_accepted_chat(ac1, ac2)
504+
505+
lp.sec("ac1: send unencrypted message to ac2")
506+
txt = "This is still unencrypted"
507+
chat.send_text(txt)
508+
msg = ac2.wait_next_incoming_message()
509+
assert msg.text == txt
510+
assert not msg.is_encrypted()
511+
512+
lp.sec("ac2: send encrypted message to ac1")
513+
txt = "This should be encrypted now"
514+
msg.chat.send_text(txt)
515+
msg2 = ac1.wait_next_incoming_message()
516+
assert msg2.is_encrypted()
517+
518+
lp.sec("ac1: forward message to ac3 unencrypted ")
519+
unencrypted_chat = ac1.create_chat(ac3)
520+
msg3 = unencrypted_chat.send_msg(msg)
521+
assert not msg3.is_encrypted()
522+
assert msg2.is_encrypted()
523+
524+
501525
def test_forward_own_message(acfactory, lp):
502526
ac1, ac2 = acfactory.get_online_accounts(2)
503527
chat = acfactory.get_accepted_chat(ac1, ac2)

0 commit comments

Comments
 (0)