Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions
email.test.test_email.TestSigned Class Reference
Inheritance diagram for email.test.test_email.TestSigned:
Inheritance graph
[legend]
Collaboration diagram for email.test.test_email.TestSigned:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_long_headers_as_string
def test_long_headers_as_string_maxheaderlen
def test_long_headers_flatten
def ndiffAssertEqual

Private Member Functions

def _msg_and_obj
def _signed_parts_eq

Detailed Description

Definition at line 4599 of file test_email.py.


Member Function Documentation

def email.test.test_email.TestSigned._msg_and_obj (   self,
  filename 
) [private]

Definition at line 4601 of file test_email.py.

04601 
04602     def _msg_and_obj(self, filename):
04603         with openfile(findfile(filename)) as fp:
04604             original = fp.read()
04605             msg = email.message_from_string(original)
04606         return original, msg

Here is the call graph for this function:

Here is the caller graph for this function:

def email.test.test_email.TestSigned._signed_parts_eq (   self,
  original,
  result 
) [private]

Definition at line 4607 of file test_email.py.

04607 
04608     def _signed_parts_eq(self, original, result):
04609         # Extract the first mime part of each message
04610         import re
04611         repart = re.compile(r'^--([^\n]+)\n(.*?)\n--\1$', re.S | re.M)
04612         inpart = repart.search(original).group(2)
04613         outpart = repart.search(result).group(2)
04614         self.assertEqual(outpart, inpart)

Here is the call graph for this function:

Here is the caller graph for this function:

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 4615 of file test_email.py.

04615 
04616     def test_long_headers_as_string(self):
04617         original, msg = self._msg_and_obj('msg_45.txt')
04618         result = msg.as_string()
04619         self._signed_parts_eq(original, result)

Here is the call graph for this function:

Definition at line 4620 of file test_email.py.

04620 
04621     def test_long_headers_as_string_maxheaderlen(self):
04622         original, msg = self._msg_and_obj('msg_45.txt')
04623         result = msg.as_string(maxheaderlen=60)
04624         self._signed_parts_eq(original, result)

Here is the call graph for this function:

Definition at line 4625 of file test_email.py.

04625 
04626     def test_long_headers_flatten(self):
04627         original, msg = self._msg_and_obj('msg_45.txt')
04628         fp = StringIO()
04629         Generator(fp).flatten(msg)
04630         result = fp.getvalue()
04631         self._signed_parts_eq(original, result)
04632 
04633 

Here is the call graph for this function:


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