end when notified about device group formed / device added sync
authorVolker Birk <vb@pep-project.org>
Sun, 14 Apr 2019 17:11:49 +0200
branchsync
changeset 267d904cc7bace5
parent 266 f5d2e0cf3c6a
child 268 81bfa5a09184
end when notified about device group formed / device added
test/sync_handshake.py
     1.1 --- a/test/sync_handshake.py	Sun Apr 14 17:07:03 2019 +0200
     1.2 +++ b/test/sync_handshake.py	Sun Apr 14 17:11:49 2019 +0200
     1.3 @@ -46,6 +46,8 @@
     1.4  SYNC_HANDSHAKE_ACCEPTED = 0
     1.5  SYNC_HANDSHAKE_REJECTED = 1
     1.6  
     1.7 +the_end = False
     1.8 +
     1.9  
    1.10  def print_msg(p):
    1.11      if isinstance(p, pathlib.Path):
    1.12 @@ -106,6 +108,12 @@
    1.13  
    1.14              except NameError:
    1.15                  self.deliverHandshakeResult(SYNC_HANDSHAKE_ACCEPTED)
    1.16 +        elif signal in (
    1.17 +                pEp.sync_handshake_signal.SYNC_NOTIFY_ACCEPTED_DEVICE_ADDED,
    1.18 +                pEp.sync_handshake_signal.SYNC_NOTIFY_ACCEPTED_GROUP_CREATED
    1.19 +            ):
    1.20 +            global the_end
    1.21 +            the_end = True
    1.22  
    1.23  
    1.24  def run(name, color=None):
    1.25 @@ -122,7 +130,7 @@
    1.26      ui = UserInterface()
    1.27  
    1.28      try:
    1.29 -        while True:
    1.30 +        while not the_end:
    1.31              l = minimail.recv_all(inbox, name)
    1.32              for n, m in l:
    1.33                  msg = pEp.Message(m)