Martin v. Löwis | efffd28 | 2000-09-30 17:03:19 +0000 | [diff] [blame] | 1 | from test_support import TestFailed |
| 2 | import mimetools |
| 3 | |
| 4 | import string,StringIO |
Fred Drake | 79e75e1 | 2001-07-20 19:05:50 +0000 | [diff] [blame] | 5 | start = string.ascii_letters + "=" + string.digits + "\n" |
Martin v. Löwis | efffd28 | 2000-09-30 17:03:19 +0000 | [diff] [blame] | 6 | for 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() |