From 7e011301724d1ed5f4059cefb9b6a2c8e4afcf5f Mon Sep 17 00:00:00 2001 From: grabowski Date: Fri, 23 Oct 2026 10:22:09 +0700 Subject: [PATCH] e2e: fixture skips empty folders --- tests/imap_fixture.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/imap_fixture.py b/tests/imap_fixture.py index a929496..57bc4b9 100644 --- a/tests/imap_fixture.py +++ b/tests/imap_fixture.py @@ -94,9 +94,12 @@ def inspect(user, password): boxes.append(m.group(3).decode()) out = {"boxes": boxes, "folders": {}} for b in boxes: - typ, _ = c.select(f'"{b}"', readonly=True) + typ, count = c.select(f'"{b}"', readonly=True) if typ != "OK": continue + if int(count[0]) == 0: # Dovecot answers FETCH 1:* on an empty box with BAD + out["folders"][b] = [] + continue typ, data = c.fetch("1:*", "(FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (MESSAGE-ID SUBJECT)])") msgs = [] for item in data: