Browse Source

test pyadpt-81.py: test start/stop sync, default/user callback impl. of pEp.message_to_send()

PYADPT-81
heck 2 years ago
parent
commit
74dcc6f7a7
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      test/pyadpt-81.py

+ 19
- 1
test/pyadpt-81.py View File

@ -2,6 +2,24 @@
# -*- coding: utf-8 -*-
import pEp
import time
def user_message_to_send(msg):
print("User defined callback implementation")
def start_stop_sync(duration):
pEp.start_sync()
time.sleep(duration)
pEp.shutdown_sync()
dir(pEp)
pEp.is_sync_active()
# test default callback
start_stop_sync(1)
# test user defined callback
pEp.message_to_send = user_message_to_send
start_stop_sync(1)
pEp.start_sync()
while(True):
print("is_sync_active: {}".format(pEp.is_sync_active()))
time.sleep(1)

Loading…
Cancel
Save