~nkarageuzian/mailman/bug-1312884

« back to all changes in this revision

Viewing changes to src/mailman/mta/docs/bulk.rst

  • Committer: Barry Warsaw
  • Date: 2014-04-28 15:23:35 UTC
  • Revision ID: barry@list.org-20140428152335-uomli7adnqf3h6dm
Use print functions consistently through, and update all __future__ imports to
reflect this.

Also, mock out sys.stderr on some tests so that their nose2 output is quieter.

A few other minor coding style consistencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    3
96
96
 
97
97
    >>> for address in sorted(chunks[0].union(chunks[1])):
98
 
    ...     print address
 
98
    ...     print(address)
99
99
    bart@example.org
100
100
    cate@example.net
101
101
    elle@example.org
113
113
    1
114
114
 
115
115
    >>> for address in sorted(chunks[2].union(chunks[3])):
116
 
    ...     print address
 
116
    ...     print(address)
117
117
    anne@example.com
118
118
    dave@example.com
119
119
    gwen@example.com
125
125
    >>> len(chunks[4])
126
126
    3
127
127
    >>> for address in sorted(chunks[4]):
128
 
    ...     print address
 
128
    ...     print(address)
129
129
    herb@example.us
130
130
    liam@example.ca
131
131
    mary@example.us
136
136
    >>> len(chunks[5])
137
137
    2
138
138
    >>> for address in sorted(chunks[5]):
139
 
    ...     print address
 
139
    ...     print(address)
140
140
    paco@example.xx
141
141
    quaq@example.zz
142
142
 
182
182
    >>> messages = list(smtpd.messages)
183
183
    >>> len(messages)
184
184
    1
185
 
    >>> print messages[0].as_string()
 
185
    >>> print(messages[0].as_string())
186
186
    From: aperson@example.org
187
187
    To: test@example.com
188
188
    Subject: test one
212
212
    5
213
213
    >>> for message in messages:
214
214
    ...     x_rcptto = message['x-rcptto']
215
 
    ...     print 'Number of recipients:', len(x_rcptto.split(','))
 
215
    ...     print('Number of recipients:', len(x_rcptto.split(',')))
216
216
    Number of recipients: 20
217
217
    Number of recipients: 20
218
218
    Number of recipients: 20
238
238
    {}
239
239
 
240
240
    >>> message = list(smtpd.messages)[0]
241
 
    >>> print message.as_string()
 
241
    >>> print(message.as_string())
242
242
    From: aperson@example.org
243
243
    To: test@example.com
244
244
    Subject: test one
257
257
    {}
258
258
 
259
259
    >>> message = list(smtpd.messages)[0]
260
 
    >>> print message.as_string()
 
260
    >>> print(message.as_string())
261
261
    From: aperson@example.org
262
262
    To: test@example.com
263
263
    Subject: test one
281
281
    {}
282
282
 
283
283
    >>> message = list(smtpd.messages)[0]
284
 
    >>> print message.as_string()
 
284
    >>> print(message.as_string())
285
285
    From: aperson@example.org
286
286
    To: test@example.com
287
287
    Subject: test one
332
332
 
333
333
    >>> failures = bulk.deliver(mlist, msg, msgdata)
334
334
    >>> for address in sorted(failures):
335
 
    ...     print address, failures[address][0], failures[address][1]
 
335
    ...     print(address, failures[address][0], failures[address][1])
336
336
    aperson@example.org 500 Error: SMTPRecipientsRefused
337
337
    bperson@example.org 500 Error: SMTPRecipientsRefused
338
338
    cperson@example.org 500 Error: SMTPRecipientsRefused
350
350
 
351
351
    >>> failures = bulk.deliver(mlist, msg, msgdata)
352
352
    >>> for address in sorted(failures):
353
 
    ...     print address, failures[address][0], failures[address][1]
 
353
    ...     print(address, failures[address][0], failures[address][1])
354
354
    aperson@example.org 450 Error: SMTPResponseException
355
355
    bperson@example.org 450 Error: SMTPResponseException
356
356
    cperson@example.org 450 Error: SMTPResponseException
361
361
 
362
362
    >>> failures = bulk.deliver(mlist, msg, msgdata)
363
363
    >>> for address in sorted(failures):
364
 
    ...     print address, failures[address][0], failures[address][1]
 
364
    ...     print(address, failures[address][0], failures[address][1])
365
365
    aperson@example.org 500 Error: SMTPResponseException
366
366
    bperson@example.org 500 Error: SMTPResponseException
367
367
    cperson@example.org 500 Error: SMTPResponseException