1 from test
import test_support
2 mimetools
= test_support
.import_module('mimetools', deprecated
=True)
3 multifile
= test_support
.import_module('multifile', deprecated
=True)
6 msg
= """Mime-Version: 1.0
7 Content-Type: multipart/mixed;
8 boundary="=====================_590453667==_"
9 X-OriginalArrivalTime: 05 Feb 2002 03:43:23.0310 (UTC) FILETIME=[42D88CE0:01C1ADF7]
11 --=====================_590453667==_
12 Content-Type: multipart/alternative;
13 boundary="=====================_590453677==_.ALT"
15 --=====================_590453677==_.ALT
16 Content-Type: text/plain; charset="us-ascii"; format=flowed
19 --=====================_590453677==_.ALT
20 Content-Type: text/html; charset="us-ascii"
23 <b>test B</font></b></html>
25 --=====================_590453677==_.ALT--
27 --=====================_590453667==_
28 Content-Type: text/plain; charset="us-ascii"
29 Content-Disposition: attachment; filename="att.txt"
36 --=====================_590453667==_--
41 global boundaries
, linecount
42 msg
= mimetools
.Message(mf
)
44 #print "TYPE: %s" % msg.gettype()
45 if msg
.getmaintype() == 'multipart':
46 boundary
= msg
.getparam("boundary")
54 lines
= mf
.readlines()
55 linecount
+= len(lines
)
58 global boundaries
, linecount
61 f
= cStringIO
.StringIO(msg
)
62 getMIMEMsg(multifile
.MultiFile(f
))
63 assert boundaries
== 2
66 if __name__
== '__main__':