From 58cff017ff45e2b90e4dd378d2a9d8a36e5ea378 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 25 Mar 2021 01:52:58 +0100 Subject: [PATCH] PYADPT-110: Add a test for start_sync() / stop_sync() repeatedly --- test/start_sync.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/start_sync.py diff --git a/test/start_sync.py b/test/start_sync.py new file mode 100755 index 0000000..1e3e5ed --- /dev/null +++ b/test/start_sync.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import pEp +import time +pEp.set_debug_log_enabled(True) + +def msg2send(message): + print("MSG2SEND") + # print(message) + +def handshake(me, partner, signal): + print("HANDSHAKE") + print(me.fpr) + print(partner.fpr) + print(signal) + +pEp.message_to_send = msg2send +pEp.notify_handshake = handshake + +alice = pEp.Identity("tedst@alice.com", "alice", "23") +pEp.myself(alice) +print(alice.fpr) + +while True: + print("start_sync()") + pEp.start_sync() + print("Running...") + time.sleep(3) + + print("shutdown_sync()") + pEp.shutdown_sync() + print("END") + time.sleep(3) +