From: Menno Smits Date: Sun, 2 May 2010 15:41:38 +0000 (+0100) Subject: Added a test for repeated UIDs (#44) X-Git-Tag: 0.7~41 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=03c6aff9c1ca963a33e1320a538f71e8ef69a88a;p=imapclient.git Added a test for repeated UIDs (#44) Courier IMAP sometimes repeats the UID on each line. This broke IMAPClient 0.5.2 but doesn't break 0.6. Added a test anyway to ensure this doesn't break in the future. --- diff --git a/imapclient/test/test_response_parser.py b/imapclient/test/test_response_parser.py index 4a77267..bc0f5af 100644 --- a/imapclient/test/test_response_parser.py +++ b/imapclient/test/test_response_parser.py @@ -207,6 +207,17 @@ class TestParseFetchResponse(unittest.TestCase): {76: {'SEQ': 23}}) + def test_repeated_UID(self): + self.assertEquals(parse_fetch_response(['23 (UID 76 FOO 123 UID 76 GOO 321)']), + {76: {'FOO': 123, + 'GOO': 321, + 'SEQ': 23}}) + self.assertEquals(parse_fetch_response(['23 (UID 76 FOO 123', 'UID 76 GOO 321)']), + {76: {'FOO': 123, + 'GOO': 321, + 'SEQ': 23}}) + + def test_bad_UID(self): self.assertRaises(ParseError, parse_fetch_response, '(UID X)')