]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Failing test added for #55
authorMenno Smits <menno@freshfoo.com>
Wed, 8 Sep 2010 12:46:49 +0000 (13:46 +0100)
committerMenno Smits <menno@freshfoo.com>
Wed, 8 Sep 2010 12:46:49 +0000 (13:46 +0100)
imapclient/test/test_response_parser.py

index 8aae15211fe2669c77cb594a02b9f2f82a19cb28..be407c9184d17191d67b3d0e7364f43ed422acd9 100644 (file)
@@ -252,6 +252,14 @@ class TestParseFetchResponse(unittest.TestCase):
                                 'SEQ': 1}})
 
 
+    def test_BODY_HEADER_FIELDS(self):
+        header_text = 'Subject: A subject\r\nFrom: Some one <someone@mail.com>\r\n\r\n'
+        self.assertEquals(parse_fetch_response(
+            [('123 (UID 31710 BODY[HEADER.FIELDS (FROM SUBJECT)] {57}', header_text), ')']),
+            { 31710: {'BODY[HEADER.FIELDS (FROM SUBJECT)]': header_text,
+                      'SEQ': 123}})
+              
+
     def test_INTERNALDATE(self):
         def check(date_str, expected_dt):
             output = parse_fetch_response(['3 (INTERNALDATE "%s")' % date_str])