Files
cc-ci/tests/mailu/functional/test_mailbox.py
autonomic-bot 9a7772563a style: repo-wide lint pass — make the lint gate green again
Push builds have been RED on the lint step since ~build 209 from accumulated
formatting drift. This is the mechanical cleanup: ruff format + ruff --fix
(UP038 isinstance unions, SIM105 contextlib.suppress, UP031 f-strings, SIM115
tempfile context manager), shfmt -i 2 -ci, nixpkgs-fmt/statix/deadnix (merged
attrsets, dropped unused lib args), yamllint, and shell quoting fixes in
tests/lasuite-docs/setup_custom_tests.sh. No behaviour changes intended;
lint: PASS, unit tests: 138 passed.
2026-06-09 21:56:15 +00:00

30 lines
1001 B
Python

"""mailu — recipe-specific functional test #1 (Phase 2 P3 §4.3 create-an-object + read-back).
Create a mailbox (the characteristic mailu object) via the admin CLI, then read it back from the
authoritative config export and assert it is present. Real create→persist→read-back, not health-only.
"""
from __future__ import annotations
import os
import sys
import uuid
sys.path.insert(0, os.path.dirname(__file__))
import _mailu # noqa: E402
def test_create_mailbox_and_read_back(live_app):
mail_domain = live_app # recipe_meta sets MAIL_DOMAIN = the per-run domain
local = "ccci-" + uuid.uuid4().hex[:8]
password = "CcCi-" + uuid.uuid4().hex[:16] + "-Aa1!"
_mailu.ensure_domain(live_app, mail_domain)
email = _mailu.create_user(live_app, local, mail_domain, password)
cfg = _mailu.config_export(live_app)
emails = _mailu.user_emails(cfg)
assert (
email in emails
), f"created mailbox {email} not present in mailu config-export users {emails}"