From: Menno Smits Date: Tue, 24 Sep 2013 22:20:14 +0000 (+0100) Subject: Made XLIST test more robust X-Git-Tag: 0.11~3^2~22 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=fb3cab1c4347c694b908e2ce833ebdb22d1c36fb;p=imapclient.git Made XLIST test more robust Don't assume that the first item returned will be for the inbox. --- diff --git a/imapclient/livetest.py b/imapclient/livetest.py index c02fa02..909daba 100644 --- a/imapclient/livetest.py +++ b/imapclient/livetest.py @@ -232,11 +232,14 @@ class TestGeneral(_TestBase): result = self.client.xlist_folders() self.assertGreater(len(result), 0, 'No folders returned by XLIST') + + foundInbox = False for flags, _, _ in result: - if '\\INBOX' in [flag.upper() for flag in flags]: + if r'\INBOX' in [flag.upper() for flag in flags]: + foundInbox = True break - else: - self.fail('INBOX not returned in XLIST output') + if not foundInbox: + self.fail('INBOX not returned in XLIST output') def test_subscriptions(self): folders = self.add_prefix_to_folders([