From 648174c22619d1b6bc321b595ef6497076775fdf Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 8 Dec 2023 12:15:39 +0100 Subject: [PATCH] don't depend on deltachat python package --- scripts/init.sh | 2 +- tests/conftest.py | 16 ++++++++++++++-- tests/test_helpers.py | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/init.sh b/scripts/init.sh index 7ba6c13d..3e19cf36 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -3,6 +3,6 @@ set -e python3 -m venv venv pip=venv/bin/pip -$pip install pyinfra pytest build 'setuptools>=68' tox deltachat +$pip install pyinfra pytest build 'setuptools>=68' tox $pip install -e deploy-chatmail $pip install -e chatmaild diff --git a/tests/conftest.py b/tests/conftest.py index 00a7853a..536902cd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -278,13 +278,13 @@ class ChatmailTestProcess: @pytest.fixture -def cmfactory(request, gencreds, tmpdir, data, maildomain): +def cmfactory(request, gencreds, tmpdir, maildomain): # cloned from deltachat.testplugin.amfactory pytest.importorskip("deltachat") from deltachat.testplugin import ACFactory testproc = ChatmailTestProcess(request.config, maildomain, gencreds) - am = ACFactory(request=request, tmpdir=tmpdir, testprocess=testproc, data=data) + am = ACFactory(request=request, tmpdir=tmpdir, testprocess=testproc, data=None) # nb. a bit hacky # would probably be better if deltachat's test machinery grows native support @@ -326,6 +326,18 @@ class Remote: break +@pytest.fixture +def lp(request): + class LP: + def sec(self, msg): + print(f"---- {msg} ----") + + def indent(self, msg): + print(f" {msg}") + + return LP() + + @pytest.fixture def maildata(request, gencreds): datadir = conftestdir.joinpath("mail-data") diff --git a/tests/test_helpers.py b/tests/test_helpers.py index ed0909d1..bb11c1e2 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -4,6 +4,7 @@ import importlib.resources from deploy_chatmail.www import build_webpages from deploy_chatmail import get_ini_settings + def create_ini(inipath): inipath.write_text( textwrap.dedent( @@ -22,6 +23,7 @@ def create_ini(inipath): ) ) + def test_build_webpages(tmp_path): pkgroot = importlib.resources.files("deploy_chatmail") src_dir = pkgroot.joinpath("../../../www/src").resolve()