Changeset 142:f5a6a5297de1 for imapclient
- Timestamp:
- 04/29/10 14:01:30 (2 years ago)
- Branch:
- default
- Location:
- imapclient
- Files:
-
- 3 modified
-
response_parser.py (modified) (1 diff)
-
test/test_IMAPClient.py (modified) (1 diff)
-
test/test_response_parser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imapclient/response_parser.py
r126 r142 208 208 literal_len, len(literal_text))) 209 209 return literal_text 210 elif token.startswith('"'):211 return token[1:-1]212 210 elif token.isdigit(): 213 211 return int(token) -
imapclient/test/test_IMAPClient.py
r135 r142 92 92 r'(\HasNoChildren) "/" "Left\"Right"', 93 93 r'(\HasNoChildren) "/" "Left\\Right"', 94 r'(\HasNoChildren) "/" "\"Left Right\""', 95 r'(\HasNoChildren) "/" "\"Left\\Right\""', 94 96 ]) 95 97 self.assertEqual(folders, [(['\\HasNoChildren'], '/', 'Test "Folder"'), 96 98 (['\\HasNoChildren'], '/', 'Left\"Right'), 97 (['\\HasNoChildren'], '/', r'Left\Right')]) 99 (['\\HasNoChildren'], '/', r'Left\Right'), 100 (['\\HasNoChildren'], '/', r'"Left Right"'), 101 (['\\HasNoChildren'], '/', r'"Left\Right"'), 102 ]) 98 103 99 104 def test_empty_response(self): -
imapclient/test/test_response_parser.py
r120 r142 133 133 134 134 def test_quoted_specials(self): 135 self._test(r'"\"foo bar\""', '"foo bar"') 135 136 self._test(r'"foo \"bar\""', 'foo "bar"') 136 137 self._test(r'"foo\\bar"', r'foo\bar') … … 157 158 to_parse = [to_parse] 158 159 output = parse_response(to_parse) 159 self.assert_( 160 output == expected, 161 format_error(to_parse, output, expected), 162 ) 160 self.assert_(output == expected, 161 format_error(to_parse, output, expected)) 163 162 164 163 def _test_parse_error(self, to_parse, expected_msg):
