diff --git a/deltachat-rpc-client/tests/test_securejoin.py b/deltachat-rpc-client/tests/test_securejoin.py index 3d2d3f58a..e66a1d6c3 100644 --- a/deltachat-rpc-client/tests/test_securejoin.py +++ b/deltachat-rpc-client/tests/test_securejoin.py @@ -13,20 +13,25 @@ def test_qr_setup_contact(acfactory) -> None: while True: event = alice.wait_for_event() if event["kind"] == "SecurejoinInviterProgress" and event["progress"] == 1000: - return + break - # Test that scanning Alice's QR code verifies Alice's profile. - bob_contact_alice = bob.get_contact_by_addr(alice.get_config("addr")) - bob_contact_alice_snapshot = bob_contact_alice.get_snapshot() - assert bob_contact_alice_snapshot.is_verified - assert bob_contact_alice_snapshot.is_profile_verified - - # Test that Alice symmetrically verified Bob's profile. + # Test that Alice verified Bob's profile. alice_contact_bob = alice.get_contact_by_addr(bob.get_config("addr")) alice_contact_bob_snapshot = alice_contact_bob.get_snapshot() assert alice_contact_bob_snapshot.is_verified assert alice_contact_bob_snapshot.is_profile_verified + while True: + event = bob.wait_for_event() + if event["kind"] == "SecurejoinJoinerProgress" and event["progress"] == 1000: + break + + # Test that Bob verified Alice's profile. + bob_contact_alice = bob.get_contact_by_addr(alice.get_config("addr")) + bob_contact_alice_snapshot = bob_contact_alice.get_snapshot() + assert bob_contact_alice_snapshot.is_verified + assert bob_contact_alice_snapshot.is_profile_verified + def test_qr_securejoin(acfactory): alice, bob = acfactory.get_online_accounts(2) @@ -42,18 +47,23 @@ def test_qr_securejoin(acfactory): if event.kind == "SecurejoinInviterProgress" and event["progress"] == 1000: break - # Test that scanning Alice's QR code verifies Alice's profile. - bob_contact_alice = bob.get_contact_by_addr(alice.get_config("addr")) - bob_contact_alice_snapshot = bob_contact_alice.get_snapshot() - assert bob_contact_alice_snapshot.is_verified - assert bob_contact_alice_snapshot.is_profile_verified - - # Test that Alice symmetrically verified Bob's profile. + # Test that Alice verified Bob's profile. alice_contact_bob = alice.get_contact_by_addr(bob.get_config("addr")) alice_contact_bob_snapshot = alice_contact_bob.get_snapshot() assert alice_contact_bob_snapshot.is_verified assert alice_contact_bob_snapshot.is_profile_verified + while True: + event = bob.wait_for_event() + if event["kind"] == "SecurejoinJoinerProgress" and event["progress"] == 1000: + break + + # Test that Bob verified Alice's profile. + bob_contact_alice = bob.get_contact_by_addr(alice.get_config("addr")) + bob_contact_alice_snapshot = bob_contact_alice.get_snapshot() + assert bob_contact_alice_snapshot.is_verified + assert bob_contact_alice_snapshot.is_profile_verified + @pytest.mark.xfail() def test_verified_group_recovery(acfactory, rpc) -> None: