mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
basic remove-users functionality and tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import pytest
|
||||
from chatmaild.config import read_config
|
||||
|
||||
|
||||
@@ -30,3 +31,19 @@ def test_read_config_testrun(make_config):
|
||||
assert config.password_min_length == 9
|
||||
assert "privacy@testrun.org" in config.passthrough_recipients
|
||||
assert config.passthrough_senders == []
|
||||
|
||||
|
||||
def test_get_user_maildir(make_config):
|
||||
config = make_config("something.testrun.org")
|
||||
assert config.mail_basedir.name == "something.testrun.org"
|
||||
assert config.mail_domain == "something.testrun.org"
|
||||
path = config.get_user_maildir("user1@something.testrun.org")
|
||||
assert not path.exists()
|
||||
assert path == config.mail_basedir.joinpath("user1@something.testrun.org")
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
config.get_user_maildir("")
|
||||
with pytest.raises(ValueError):
|
||||
config.get_user_maildir(None)
|
||||
with pytest.raises(ValueError):
|
||||
config.get_user_maildir("../some@something.testrun.org")
|
||||
|
||||
Reference in New Issue
Block a user