From ed8ff2728f0832509a5a7e9b1637261d00a8e5bf Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Mon, 1 Apr 2024 17:42:48 -0400 Subject: [PATCH] format --- mail4one/pop3.py | 8 ++++---- tests/test_pop.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index 9600de8..f6bde47 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -219,8 +219,8 @@ def trans_command_retr(mails: MailList, req: Request) -> None: write(ok("Contents follow")) with get_mail_fp(entry) as fp: for line in fp: - if line.startswith(b'.'): - write(b'.') # prepend dot + if line.startswith(b"."): + write(b".") # prepend dot write(line) # write(get_mail(entry)) # no prepend dot write(end()) @@ -396,9 +396,9 @@ def debug_main(): _, mails_path, mbox = sys.argv mails_path = Path(mails_path) - users = [ User(username="dummy", password_hash=gen_pwhash("dummy"), mbox=mbox) ] + users = [User(username="dummy", password_hash=gen_pwhash("dummy"), mbox=mbox)] - asyncio.run(a_main("127.0.0.1", 1101, mails_path, users=users)) + 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 f5def85..1e17d38 100644 --- a/tests/test_pop.py +++ b/tests/test_pop.py @@ -218,14 +218,15 @@ class TestPop3(unittest.IsolatedAsyncioTestCase): pc = poplib.POP3("127.0.0.1", 7995) try: self.assertEqual(b"+OK Server Ready", pc.getwelcome()) - self.assertEqual(b'+OK Welcome', pc.user("foo2")) - self.assertEqual(b'+OK Login successful', pc.pass_("helloworld")) + self.assertEqual(b"+OK Welcome", pc.user("foo2")) + self.assertEqual(b"+OK Login successful", pc.pass_("helloworld")) _, eml, oc = pc.retr(1) self.assertIn(b"Previous line just has a dot", eml) self.assertIn(b".Line starts with a dot", eml) self.assertIn(b".", eml) finally: pc.quit() + await asyncio.to_thread(run_poplib) async def asyncTearDown(self) -> None: