Back to index

python3.2  3.2.2
Public Member Functions
email.test.test_email_torture.TestCrispinTorture Class Reference
Inheritance diagram for email.test.test_email_torture.TestCrispinTorture:
Inheritance graph
[legend]
Collaboration diagram for email.test.test_email_torture.TestCrispinTorture:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_mondo_message
def ndiffAssertEqual

Detailed Description

Definition at line 46 of file test_email_torture.py.


Member Function Documentation

def email.test.test_email.TestEmailBase.ndiffAssertEqual (   self,
  first,
  second 
) [inherited]
Like assertEqual except use ndiff for readable output.

Definition at line 57 of file test_email.py.

00057 
00058     def ndiffAssertEqual(self, first, second):
00059         """Like assertEqual except use ndiff for readable output."""
00060         if first != second:
00061             sfirst = str(first)
00062             ssecond = str(second)
00063             rfirst = [repr(line) for line in sfirst.splitlines()]
00064             rsecond = [repr(line) for line in ssecond.splitlines()]
00065             diff = difflib.ndiff(rfirst, rsecond)
00066             raise self.failureException(NL + NL.join(diff))

Here is the call graph for this function:

Definition at line 48 of file test_email_torture.py.

00048 
00049     def test_mondo_message(self):
00050         eq = self.assertEqual
00051         neq = self.ndiffAssertEqual
00052         msg = self._msgobj('crispin-torture.txt')
00053         payload = msg.get_payload()
00054         eq(type(payload), ListType)
00055         eq(len(payload), 12)
00056         eq(msg.preamble, None)
00057         eq(msg.epilogue, '\n')
00058         # Probably the best way to verify the message is parsed correctly is to
00059         # dump its structure and compare it against the known structure.
00060         fp = StringIO()
00061         _structure(msg, fp=fp)
00062         neq(fp.getvalue(), """\
00063 multipart/mixed
00064     text/plain
00065     message/rfc822
00066         multipart/alternative
00067             text/plain
00068             multipart/mixed
00069                 text/richtext
00070             application/andrew-inset
00071     message/rfc822
00072         audio/basic
00073     audio/basic
00074     image/pbm
00075     message/rfc822
00076         multipart/mixed
00077             multipart/mixed
00078                 text/plain
00079                 audio/x-sun
00080             multipart/mixed
00081                 image/gif
00082                 image/gif
00083                 application/x-be2
00084                 application/atomicmail
00085             audio/x-sun
00086     message/rfc822
00087         multipart/mixed
00088             text/plain
00089             image/pgm
00090             text/plain
00091     message/rfc822
00092         multipart/mixed
00093             text/plain
00094             image/pbm
00095     message/rfc822
00096         application/postscript
00097     image/gif
00098     message/rfc822
00099         multipart/mixed
00100             audio/basic
00101             audio/basic
00102     message/rfc822
00103         multipart/mixed
00104             application/postscript
00105             text/plain
00106             message/rfc822
00107                 multipart/mixed
00108                     text/plain
00109                     multipart/parallel
00110                         image/gif
00111                         audio/basic
00112                     application/atomicmail
00113                     message/rfc822
00114                         audio/x-sun
00115 """)
00116 


Here is the call graph for this function:


The documentation for this class was generated from the following file: