From f3e80c43ae1a7270817dbe19cd7a72e3380e9d48 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Mon, 1 Apr 2024 17:45:37 -0400 Subject: [PATCH] Fix debug_main and minor cleanup --- mail4one/pop3.py | 7 ++++--- tests/test_pop.py | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index 3214ce9..71c925b 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -386,13 +386,14 @@ def debug_main(): logging.basicConfig(level=logging.DEBUG) import sys + from .pwhash import gen_pwhash - _, mails_path, port, password = sys.argv + _, mails_path, mbox = sys.argv mails_path = Path(mails_path) - port = int(port) + users = [User(username="dummy", password_hash=gen_pwhash("dummy"), mbox=mbox)] - asyncio.run(a_main(mails_path, port, password_hash=password_hash)) + asyncio.run(a_main("127.0.0.1", 1101, mails_path, users=users)) if __name__ == "__main__": diff --git a/tests/test_pop.py b/tests/test_pop.py index 93fd879..4deda58 100644 --- a/tests/test_pop.py +++ b/tests/test_pop.py @@ -9,13 +9,11 @@ from mail4one.config import User from pathlib import Path TEST_HASH = "".join( - c - for c in """ + """ AFTY5EVN7AX47ZL7UMH3BETYWFBTAV3XHR73CEFAJBPN2NIHPWD ZHV2UQSMSPHSQQ2A2BFQBNC77VL7F2UKATQNJZGYLCSU6C43UQD AQXWXSWNGAEPGIMG2F3QDKBXL3MRHY6K2BPID64ZR6LABLPVSF -""" - if not c.isspace() +""".split() ) TEST_USER = "foobar" @@ -42,7 +40,8 @@ Hello bro\r IlzVOJqu9Zp7twFAtzcV\r yQVk36B0mGU2gtWxXLr\r PeF0RtbI0mAuVPLQDHCi\r -\r\n""" +\r +""" def setUpModule() -> None: