From 74dcc6f7a7e9682ecb0ee14c5ef3146829e08373 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 20 Aug 2020 14:36:37 +0200 Subject: [PATCH] test pyadpt-81.py: test start/stop sync, default/user callback impl. of pEp.message_to_send() --- test/pyadpt-81.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/pyadpt-81.py b/test/pyadpt-81.py index 6ff7021..7fa0d45 100644 --- a/test/pyadpt-81.py +++ b/test/pyadpt-81.py @@ -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() \ No newline at end of file +# 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) \ No newline at end of file