Skip to content

Commit

Permalink
fix some test and formatting/ruff issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hpk42 committed Mar 21, 2024
1 parent 8d9019b commit e32fb37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
14 changes: 6 additions & 8 deletions cmdeploy/src/cmdeploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ def _configure_dovecot(config: Config, debug: bool = False) -> bool:
need_restart |= lua_push_notification_script.changed

sieve_script = files.put(
src=importlib.resources.files(__package__).joinpath(
"dovecot/default.sieve"
),
src=importlib.resources.files(__package__).joinpath("dovecot/default.sieve"),
dest="/etc/dovecot/default.sieve",
user="root",
group="root",
Expand All @@ -361,10 +359,8 @@ def _configure_dovecot(config: Config, debug: bool = False) -> bool:
need_restart |= sieve_script.changed
if sieve_script.changed:
server.shell(
name=f"compile sieve script",
commands=[
f"/usr/bin/sievec /etc/dovecot/default.sieve"
],
name="compile sieve script",
commands=["/usr/bin/sievec /etc/dovecot/default.sieve"],
)

files.template(
Expand Down Expand Up @@ -457,7 +453,9 @@ def check_config(config):
blocked_words = "merlinux schmieder testrun.org".split()
for key in config.__dict__:
value = config.__dict__[key]
if key.startswith("privacy") and any(x in str(value) for x in blocked_words):
if key.startswith("privacy") and any(
x in str(value) for x in blocked_words
):
raise ValueError(
f"please set your own privacy contacts/addresses in {config._inipath}"
)
Expand Down
2 changes: 0 additions & 2 deletions cmdeploy/src/cmdeploy/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import subprocess
import datetime

from typing import Optional


class DNS:
def __init__(self, out, mail_domain):
Expand Down
8 changes: 4 additions & 4 deletions cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def parse_size_limit(limit: str) -> int:

addr = ac2.get_config("addr").lower()
saved_ok = 0
for line in remote.iter_output("journalctl -f -u dovecot"):
for line in remote.iter_output("journalctl -n0 -f -u dovecot"):
if addr not in line:
# print(line)
continue
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_read_receipts_between_instances(self, cmfactory, lp, maildomain2):
lp.sec("ac1 sends a message and ac2 marks it as seen")
chat = ac1.create_chat(ac2)
msg = chat.send_text("hi")
m = ac2.wait_next_incoming_message()
m = ac2._evtracker.wait_next_incoming_message()
m.mark_seen()
# we can only indirectly wait for mark-seen to cause an smtp-error
lp.sec("try to wait for markseen to complete and check error states")
Expand All @@ -132,7 +132,7 @@ def test_hide_senders_ip_address(cmfactory):
chat = cmfactory.get_accepted_chat(user1, user2)

chat.send_text("testing submission header cleanup")
user2.wait_next_incoming_message()
user2._evtracker.wait_next_incoming_message()
user2.direct_imap.select_folder("Inbox")
msg = user2.direct_imap.get_all_messages()[0]
assert public_ip not in msg.obj.as_string()
Expand All @@ -146,5 +146,5 @@ def test_echobot(cmfactory, chatmail_config, lp):
text = "hi, I hope you text me back"
chat.send_text(text)
lp.sec("Wait for reply from echobot")
reply = ac.wait_next_incoming_message()
reply = ac._evtracker.wait_next_incoming_message()
assert reply.text == text

0 comments on commit e32fb37

Please sign in to comment.