Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efffd28

Browse files
committed
Add mimetools testcase.
1 parent 25d1692 commit efffd28

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lib/test/output/test_mimetools

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test_mimetools
2+
7bit PASS
3+
8bit PASS
4+
base64 PASS
5+
quoted-printable PASS

Lib/test/test_mimetools.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from test_support import TestFailed
2+
import mimetools
3+
4+
import string,StringIO
5+
start = string.letters + "=" + string.digits + "\n"
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()

0 commit comments

Comments
 (0)