fix test and streamline impl

This commit is contained in:
holger krekel
2025-03-27 17:35:51 +01:00
parent 0722876603
commit ce240083c4
2 changed files with 9 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ def main(vmail_dir=None):
ci_accounts = 0
for path in Path(vmail_dir).iterdir():
if not path.is_dir() or not (path / "cur").is_dir():
if not path.joinpath("cur").is_dir():
continue
accounts += 1
if path.name[:3] in ("ci-", "ac_"):

View File

@@ -2,8 +2,15 @@ from chatmaild.metrics import main
def test_main(tmp_path, capsys):
paths = []
for x in ("ci-asllkj", "ac_12l3kj", "qweqwe", "ci-l1k2j31l2k3"):
tmp_path.joinpath(x).mkdir()
p = tmp_path.joinpath(x)
p.mkdir()
p.joinpath("cur").mkdir()
paths.append(p)
tmp_path.joinpath("nomailbox").mkdir()
main(tmp_path)
out, _ = capsys.readouterr()
d = {}