move doveauth scripts to its own python project

This commit is contained in:
missytake
2023-10-13 17:57:43 +02:00
committed by holger krekel
parent 556d9d37a4
commit 344e799a51
5 changed files with 3 additions and 3 deletions

23
doveauth/test_doveauth.py Normal file
View File

@@ -0,0 +1,23 @@
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