test(deltachat-rpc-client): fix securejoin tests

Wait for Bob (joiner) progress 1000
and do not return too early in test_qr_setup_contact().
This commit is contained in:
link2xt
2023-11-09 01:20:21 +00:00
parent 0fe94e47cc
commit 543864f0f5

View File

@@ -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: