Changeset 171:81ccefd2036e for imapclient
- Timestamp:
- 09/10/10 20:27:56 (21 months ago)
- Branch:
- default
- Children:
- 172:6317981e42a5, 179:970ef3c54d53
- Location:
- imapclient
- Files:
-
- 2 modified
-
response_lexer.py (modified) (1 diff)
-
test/test_response_parser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imapclient/response_lexer.py
r169 r171 82 82 if nextchar in wordchars: 83 83 token += nextchar 84 elif nextchar == '[': 85 token += nextchar + read_until(stream_i, ']', escape=False) 84 86 else: 85 if nextchar == '[': 86 yield token + nextchar + read_until(stream_i, ']', escape=False) 87 elif nextchar in whitespace: 87 if nextchar in whitespace: 88 88 yield token 89 89 elif nextchar == '"': -
imapclient/test/test_response_parser.py
r170 r171 140 140 self._test('foo[bar rrr]', 'foo[bar rrr]') 141 141 self._test('"foo[bar rrr]"', 'foo[bar rrr]') 142 self._test('[foo bar] ', '[foo bar]') # Square brackets at start142 self._test('[foo bar]def', '[foo bar]def') 143 143 self._test('(foo [bar rrr])', ('foo', '[bar rrr]')) 144 144 self._test('(foo foo[bar rrr])', ('foo', 'foo[bar rrr]')) … … 265 265 { 31710: {'BODY[HEADER.FIELDS (FROM SUBJECT)]': header_text, 266 266 'SEQ': 123}}) 267 267 268 269 def test_partial_fetch(self): 270 body = '01234567890123456789' 271 self.assertEquals(parse_fetch_response( 272 [('123 (UID 367 BODY[]<0> {20}', body), ')']), 273 { 367: {'BODY[]<0>': body, 274 'SEQ': 123}}) 275 268 276 269 277 def test_INTERNALDATE(self):
