Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 2a9b0a93091b9ef7350a94bb3d3f1c43725b7a8c authored by Georg Brandl on 05 March 2011, 13:54:19 UTC
Close 2.0 branch.
Tip revision: 2a9b0a9
test_mimetools.py
from test_support import TestFailed
import mimetools

import string,StringIO
start = string.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