mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
fix init.sh and test.sh
use tox for chatmaild non-online tests
This commit is contained in:
@@ -20,7 +20,7 @@ addopts = "-v -ra --strict-markers"
|
||||
legacy_tox_ini = """
|
||||
[tox]
|
||||
isolated_build = true
|
||||
envlist = lint
|
||||
envlist = lint,py
|
||||
|
||||
[testenv:lint]
|
||||
skipdist = True
|
||||
@@ -31,4 +31,10 @@ deps =
|
||||
commands =
|
||||
black --quiet --check --diff src/
|
||||
ruff src/
|
||||
|
||||
[testenv]
|
||||
passenv = CHATMAIL_DOMAIN
|
||||
deps = pytest
|
||||
pdbpp
|
||||
commands = pytest -v -rsXx {posargs: ../tests/chatmaild}
|
||||
"""
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
python3 -m venv deploy-chatmail/venv
|
||||
deploy-chatmail/venv/bin/pip install pyinfra pytest
|
||||
deploy-chatmail/venv/bin/pip install -e deploy-chatmail
|
||||
deploy-chatmail/venv/bin/pip install -e chatmaild
|
||||
python3 -m venv venv
|
||||
pip=venv/bin/pip
|
||||
|
||||
python3 -m venv chatmaild/venv
|
||||
chatmaild/venv/bin/pip install --upgrade pytest build 'setuptools>=68'
|
||||
chatmaild/venv/bin/pip install -e chatmaild
|
||||
|
||||
python3 -m venv online-tests/venv
|
||||
online-tests/venv/bin/pip install pytest pytest-timeout pdbpp deltachat
|
||||
$pip install pyinfra pytest build 'setuptools>=68' tox
|
||||
$pip install -e deploy-chatmail
|
||||
$pip install -e chatmaild
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
#!/bin/bash
|
||||
chatmaild/venv/bin/pytest chatmaild/ $@
|
||||
online-tests/venv/bin/pytest online-tests/ -vrx --durations=5 $@
|
||||
|
||||
pushd chatmaild
|
||||
tox
|
||||
popd
|
||||
|
||||
pushd deploy-chatmail
|
||||
tox
|
||||
popd
|
||||
|
||||
venv/bin/pytest tests/online -vrx --durations=5 $@
|
||||
|
||||
@@ -2,6 +2,12 @@ from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def maildomain():
|
||||
# let's not depend on a real chatmail instance for the offline tests below
|
||||
return "chatmail.example.org"
|
||||
|
||||
|
||||
def test_reject_forged_from(maildata, gencreds):
|
||||
class env:
|
||||
mail_from = gencreds()[0]
|
||||
|
||||
Reference in New Issue
Block a user