From 03c6aff9c1ca963a33e1320a538f71e8ef69a88a Mon Sep 17 00:00:00 2001 From: Menno Smits Date: Sun, 2 May 2010 16:41:38 +0100 Subject: [PATCH] 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. --- imapclient/test/test_response_parser.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)') -- 2.43.0