add smtp tests and fix scripts

This commit is contained in:
holger krekel
2023-10-14 12:01:39 +02:00
parent 5cd54026a8
commit 1742ee07c8
3 changed files with 22 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import imaplib
import smtplib
import itertools
import pytest
@@ -21,6 +22,24 @@ class ImapConn:
self.conn.login(user, password)
@pytest.fixture
def smtp():
return SmtpConn("c1.testrun.org")
class SmtpConn:
def __init__(self, host):
self.host = host
def connect(self):
print(f"smtp-connect {self.host}")
self.conn = smtplib.SMTP_SSL(self.host)
def login(self, user, password):
print(f"smtp-login {user!r} {password!r}")
self.conn.login(user, password)
@pytest.fixture
def gencreds():
count = itertools.count()