mirror of
https://github.com/chatmail/relay.git
synced 2026-05-13 17:34:38 +00:00
24 lines
616 B
Python
24 lines
616 B
Python
import subprocess
|
|
import pytest
|
|
|
|
from doveauth import get_user_data, verify_user
|
|
|
|
|
|
def test_basic():
|
|
data = get_user_data("link2xt@c1.testrun.org")
|
|
assert data
|
|
|
|
|
|
@pytest.mark.xfail(reason="no persistence yet")
|
|
def test_verify_or_create():
|
|
res = verify_user("newuser1@something.org", "kajdlkajsldk12l3kj1983")
|
|
assert res["status"] == "ok"
|
|
res = verify_user("newuser1@something.org", "kajdlqweqwe")
|
|
assert res["status"] == "fail"
|
|
|
|
|
|
def test_lua_integration(request):
|
|
p = request.fspath.dirpath("test_doveauth.lua")
|
|
proc = subprocess.run(["lua", str(p)])
|
|
assert proc.returncode == 0
|