Skip to content

Commit

Permalink
test: test that joining a group verifies Alice and vice versa
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Nov 8, 2023
1 parent ad51a7c commit 0c22767
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions deltachat-rpc-client/tests/test_securejoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,34 @@ def test_qr_setup_contact(acfactory) -> None:
assert alice_contact_bob_snapshot.is_profile_verified


@pytest.mark.xfail()
def test_qr_securejoin(acfactory):
alice, bob = acfactory.get_online_accounts(2)

logging.info("Alice creates a verified group")
alice_chat = alice.create_group("Verified group", protect=True)

logging.info("Bob joins verified group")
qr_code, _svg = alice_chat.get_qr_code()
bob.secure_join(qr_code)
while True:
event = alice.wait_for_event()
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.
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


@pytest.mark.xfail()
def test_verified_group_recovery(acfactory, rpc) -> None:
ac1, ac2, ac3 = acfactory.get_online_accounts(3)
Expand Down

0 comments on commit 0c22767

Please sign in to comment.