diff --git a/test/minimail.py b/test/minimail.py index a8ab7f9..689b6f4 100644 --- a/test/minimail.py +++ b/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 diff --git a/test/sync_handshake.py b/test/sync_handshake.py index b696aad..782b617 100644 --- a/test/sync_handshake.py +++ b/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("\n" + msg.attachments[0].decode()) - minimail.send(msg) + minimail.send(inbox, msg) class UserInterface(pEp.UserInterface):