Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 84d6457fe4b92730de50847cb238f942cd04937a authored by Georg Brandl on 05 March 2011, 13:55:23 UTC
Close 2.2 branch.
Tip revision: 84d6457
test_mimetools.py
from test_support import TestFailed
import mimetools

import string,StringIO
start = string.ascii_letters + "=" + string.digits + "\n"
for enc in ['7bit','8bit','base64','quoted-printable']:
    print enc,
    i = StringIO.StringIO(start)
    o = StringIO.StringIO()
    mimetools.encode(i,o,enc)
    i = StringIO.StringIO(o.getvalue())
    o = StringIO.StringIO()
    mimetools.decode(i,o,enc)
    if o.getvalue()==start:
        print "PASS"
    else:
        print "FAIL"
        print o.getvalue()
back to top