refactor dovecot tests, move online tests one level up

This commit is contained in:
holger krekel
2023-10-14 11:34:09 +02:00
parent 290933e8b2
commit c7dfd7ca41
6 changed files with 65 additions and 34 deletions

View File

@@ -0,0 +1,18 @@
import pytest
import imaplib
class TestDovecot:
def test_login_ok(self, imap, gencreds):
user, password = gencreds()
imap.connect()
imap.login(user, password)
def test_login_fail(self, imap, gencreds):
user, password = gencreds()
imap.connect()
imap.login(user, password)
imap.connect()
with pytest.raises(imaplib.IMAP4.error) as excinfo:
imap.login(user, password + "wrong")
assert "AUTHENTICATIONFAILED" in str(excinfo)