mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 13:26:28 +03:00
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:
@@ -13,20 +13,25 @@ def test_qr_setup_contact(acfactory) -> None:
|
|||||||
while True:
|
while True:
|
||||||
event = alice.wait_for_event()
|
event = alice.wait_for_event()
|
||||||
if event["kind"] == "SecurejoinInviterProgress" and event["progress"] == 1000:
|
if event["kind"] == "SecurejoinInviterProgress" and event["progress"] == 1000:
|
||||||
return
|
break
|
||||||
|
|
||||||
# Test that scanning Alice's QR code verifies Alice's profile.
|
# Test that Alice verified Bob'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 = alice.get_contact_by_addr(bob.get_config("addr"))
|
||||||
alice_contact_bob_snapshot = alice_contact_bob.get_snapshot()
|
alice_contact_bob_snapshot = alice_contact_bob.get_snapshot()
|
||||||
assert alice_contact_bob_snapshot.is_verified
|
assert alice_contact_bob_snapshot.is_verified
|
||||||
assert alice_contact_bob_snapshot.is_profile_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):
|
def test_qr_securejoin(acfactory):
|
||||||
alice, bob = acfactory.get_online_accounts(2)
|
alice, bob = acfactory.get_online_accounts(2)
|
||||||
@@ -42,18 +47,23 @@ def test_qr_securejoin(acfactory):
|
|||||||
if event.kind == "SecurejoinInviterProgress" and event["progress"] == 1000:
|
if event.kind == "SecurejoinInviterProgress" and event["progress"] == 1000:
|
||||||
break
|
break
|
||||||
|
|
||||||
# Test that scanning Alice's QR code verifies Alice's profile.
|
# Test that Alice verified Bob'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 = alice.get_contact_by_addr(bob.get_config("addr"))
|
||||||
alice_contact_bob_snapshot = alice_contact_bob.get_snapshot()
|
alice_contact_bob_snapshot = alice_contact_bob.get_snapshot()
|
||||||
assert alice_contact_bob_snapshot.is_verified
|
assert alice_contact_bob_snapshot.is_verified
|
||||||
assert alice_contact_bob_snapshot.is_profile_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()
|
@pytest.mark.xfail()
|
||||||
def test_verified_group_recovery(acfactory, rpc) -> None:
|
def test_verified_group_recovery(acfactory, rpc) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user