Changeset 139:be5626eee037
- Timestamp:
- 17/03/10 02:10:37 (23 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
Added tests for partial fetches
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r138
|
r139
|
|
| 330 | 330 | None, None, None, |
| 331 | 331 | '<1A472770E042064698CB5ADC83A12ACD39455AAB@ABC>') |
| 332 | | |
| | 332 | |
| | 333 | |
| | 334 | def test_partial_fetch(client): |
| | 335 | clear_folder(client, 'INBOX') |
| | 336 | client.append('INBOX', MULTIPART_MESSAGE) |
| | 337 | client.select_folder('INBOX') |
| | 338 | msg_id = client.search()[0] |
| | 339 | |
| | 340 | resp = client.fetch(msg_id, ['BODY[]<0.20>']) |
| | 341 | body = resp[msg_id]['BODY[]<0>'] |
| | 342 | assert len(body) == 20 |
| | 343 | assert body.startswith('From: Bob Smith') |
| | 344 | |
| | 345 | resp = client.fetch(msg_id, ['BODY[]<2.25>']) |
| | 346 | body = resp[msg_id]['BODY[]<2>'] |
| | 347 | assert len(body) == 25 |
| | 348 | assert body.startswith('om: Bob Smith') |
| | 349 | |
| 333 | 350 | |
| 334 | 351 | def assert_raises(exception_class, func, *args, **kwargs): |
| … |
… |
|
| 357 | 374 | test_search(client) |
| 358 | 375 | test_fetch(client) |
| | 376 | test_partial_fetch(client) |
| 359 | 377 | test_copy(client) |
| 360 | 378 | |