Browse Source

minimail write

PYADPT-55
Volker Birk 6 years ago
parent
commit
5a2f387735
  1. 4
      test/sync_handshake.py
  2. 12
      test/sync_test.py

4
test/sync_handshake.py

@ -7,11 +7,13 @@
import pEp
import minimail
def messageToSend(msg):
# this is assuming that msg is unencrypted; only true for beacons
print("<!-- " + str(msg.from_) + " -->\n" + msg.attachments[0].decode())
minimail.send(msg)
class UserInterface(pEp.UserInterface):
@ -20,7 +22,7 @@ class UserInterface(pEp.UserInterface):
def run(path):
me = pEp.Identity(path + "@peptest.ch", path + " Neuman")
me = pEp.Identity("alice@peptest.ch", path + " Neuman")
pEp.myself(me)
pEp.messageToSend = messageToSend
ui = UserInterface()

12
test/sync_test.py

@ -78,21 +78,21 @@ optParser.add_option("-c", "--clean", action="store_true", dest="clean")
if options.clean:
rmrf("TestInbox")
rmrf("Alice")
rmrf("Bob")
rmrf("Barbara")
else:
os.makedirs("TestInbox", exist_ok=True)
setup("Alice")
setup("Bob")
setup("Barbara")
Alice = os.fork()
if Alice == 0:
test_for("Alice")
else:
Bob = os.fork()
if Bob == 0:
test_for("Bob")
Barbara = os.fork()
if Barbara == 0:
test_for("Barbara")
else:
waitpid(Alice)
waitpid(Bob)
waitpid(Barbara)

Loading…
Cancel
Save