blob: 0300714d76f84a4fcf3e98b46077ceafeccf2e0a [file] [log] [blame]
Martin v. Löwisefffd282000-09-30 17:03:19 +00001from test_support import TestFailed
2import mimetools
3
4import string,StringIO
Fred Drake79e75e12001-07-20 19:05:50 +00005start = string.ascii_letters + "=" + string.digits + "\n"
Martin v. Löwisefffd282000-09-30 17:03:19 +00006for enc in ['7bit','8bit','base64','quoted-printable']:
7 print enc,
8 i = StringIO.StringIO(start)
9 o = StringIO.StringIO()
10 mimetools.encode(i,o,enc)
11 i = StringIO.StringIO(o.getvalue())
12 o = StringIO.StringIO()
13 mimetools.decode(i,o,enc)
14 if o.getvalue()==start:
15 print "PASS"
16 else:
17 print "FAIL"
18 print o.getvalue()