mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
apply last review suggestions
This commit is contained in:
@@ -24,7 +24,7 @@ class Config:
|
||||
self.passthrough_senders = params["passthrough_senders"].split()
|
||||
self.passthrough_recipients = params["passthrough_recipients"].split()
|
||||
self.mailboxes_dir = Path(params["mailboxes_dir"].strip())
|
||||
self.passdb_path = params["passdb_path"].strip().rstrip("/")
|
||||
self.passdb_path = Path(params["passdb_path"].strip())
|
||||
self.filtermail_smtp_port = int(params["filtermail_smtp_port"])
|
||||
self.postfix_reinject_port = int(params["postfix_reinject_port"])
|
||||
self.iroh_relay = params.get("iroh_relay")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from chatmaild.config import read_config
|
||||
|
||||
@@ -38,12 +36,12 @@ def test_read_config_testrun(make_config):
|
||||
def test_config_userstate_paths(make_config, tmp_path):
|
||||
config = make_config("something.testrun.org")
|
||||
mailboxes_dir = config.mailboxes_dir
|
||||
passdb_path = Path(config.passdb_path)
|
||||
passdb_path = config.passdb_path
|
||||
assert mailboxes_dir.name == "something.testrun.org"
|
||||
assert passdb_path.name == "passdb.sqlite"
|
||||
assert passdb_path.is_relative_to(tmp_path)
|
||||
assert config.mail_domain == "something.testrun.org"
|
||||
path = Path(config.get_user_maildir("user1@something.testrun.org"))
|
||||
path = config.get_user_maildir("user1@something.testrun.org")
|
||||
assert not path.exists()
|
||||
assert path == mailboxes_dir.joinpath("user1@something.testrun.org")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user