Browse Source

inbox concept in minimail

PYADPT-55
Volker Birk 6 years ago
parent
commit
7d587df460
  1. 8
      test/minimail.py
  2. 6
      test/sync_handshake.py

8
test/minimail.py

@ -6,17 +6,15 @@
# this file is under GNU General Public License 3.0
import pathlib
import pEp
from secrets import token_urlsafe
def send(msg):
def send(inbox, msg):
name = token_urlsafe(16) + ".eml"
parent = pathlib.Path("..")
with open(parent / "TestInbox" / name, "wb") as f:
with open(inbox / name, "wb") as f:
f.write(str(msg).encode())
def recv(msg):
def recv(inbox):
pass

6
test/sync_handshake.py

@ -6,14 +6,18 @@
# this file is under GNU General Public License 3.0
import pathlib
import pEp
import minimail
inbox = pathlib.Path("..") / "TestInbox"
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)
minimail.send(inbox, msg)
class UserInterface(pEp.UserInterface):

Loading…
Cancel
Save