mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 12:58:04 +00:00
add smtp tests and fix scripts
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import imaplib
|
import imaplib
|
||||||
|
import smtplib
|
||||||
import itertools
|
import itertools
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -21,6 +22,24 @@ class ImapConn:
|
|||||||
self.conn.login(user, password)
|
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
|
@pytest.fixture
|
||||||
def gencreds():
|
def gencreds():
|
||||||
count = itertools.count()
|
count = itertools.count()
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ doveauth/venv/bin/pip install pytest build
|
|||||||
doveauth/venv/bin/pip install -e doveauth
|
doveauth/venv/bin/pip install -e doveauth
|
||||||
|
|
||||||
python3 -m venv online-tests/venv
|
python3 -m venv online-tests/venv
|
||||||
online-tests/venv/bin/pip install pytest pytest-timeout
|
online-tests/venv/bin/pip install pytest pytest-timeout pdbpp
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
pushd doveauth/src/doveauth
|
pushd doveauth/src/doveauth
|
||||||
../../venv/bin/pytest
|
../../venv/bin/pytest
|
||||||
popd
|
popd
|
||||||
online-tests/venv/bin/pytest online-tests/
|
|
||||||
|
online-tests/venv/bin/pytest online-tests/ -vrx
|
||||||
|
|||||||
Reference in New Issue
Block a user