Back to index

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

List of all members.

Public Member Functions

def test_rfc2047_multiline
def test_whitespace_eater_unicode
def test_whitespace_eater_unicode_2
def test_rfc2047_missing_whitespace
def test_rfc2047_with_whitespace
def test_rfc2047_B_bad_padding
def test_rfc2047_Q_invalid_digits
def ndiffAssertEqual

Detailed Description

Definition at line 1914 of file test_email.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 1962 of file test_email.py.

01962 
01963     def test_rfc2047_B_bad_padding(self):
01964         s = '=?iso-8859-1?B?%s?='
01965         data = [                                # only test complete bytes
01966             ('dm==', b'v'), ('dm=', b'v'), ('dm', b'v'),
01967             ('dmk=', b'vi'), ('dmk', b'vi')
01968           ]
01969         for q, a in data:
01970             dh = decode_header(s % q)
01971             self.assertEqual(dh, [(a, 'iso-8859-1')])

Here is the call graph for this function:

Definition at line 1950 of file test_email.py.

01950 
01951     def test_rfc2047_missing_whitespace(self):
01952         s = 'Sm=?ISO-8859-1?B?9g==?=rg=?ISO-8859-1?B?5Q==?=sbord'
01953         dh = decode_header(s)
01954         self.assertEqual(dh, [(s, None)])

Here is the call graph for this function:

Definition at line 1915 of file test_email.py.

01915 
01916     def test_rfc2047_multiline(self):
01917         eq = self.assertEqual
01918         s = """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz
01919  foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?="""
01920         dh = decode_header(s)
01921         eq(dh, [
01922             (b'Re:', None),
01923             (b'r\x8aksm\x9arg\x8cs', 'mac-iceland'),
01924             (b'baz foo bar', None),
01925             (b'r\x8aksm\x9arg\x8cs', 'mac-iceland')])
01926         header = make_header(dh)
01927         eq(str(header),
01928            'Re: r\xe4ksm\xf6rg\xe5s baz foo bar r\xe4ksm\xf6rg\xe5s')
01929         self.ndiffAssertEqual(header.encode(maxlinelen=76), """\
01930 Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar =?mac-iceland?q?r=8Aksm?=
01931  =?mac-iceland?q?=9Arg=8Cs?=""")

Here is the call graph for this function:

Definition at line 1972 of file test_email.py.

01972 
01973     def test_rfc2047_Q_invalid_digits(self):
01974         # issue 10004.
01975         s = '=?iso-8659-1?Q?andr=e9=zz?='
01976         self.assertEqual(decode_header(s),
01977                         [(b'andr\xe9=zz', 'iso-8659-1')])
01978 
01979 
# Test the MIMEMessage class

Here is the call graph for this function:

Definition at line 1955 of file test_email.py.

01955 
01956     def test_rfc2047_with_whitespace(self):
01957         s = 'Sm =?ISO-8859-1?B?9g==?= rg =?ISO-8859-1?B?5Q==?= sbord'
01958         dh = decode_header(s)
01959         self.assertEqual(dh, [(b'Sm', None), (b'\xf6', 'iso-8859-1'),
01960                               (b'rg', None), (b'\xe5', 'iso-8859-1'),
01961                               (b'sbord', None)])

Here is the call graph for this function:

Definition at line 1932 of file test_email.py.

01932 
01933     def test_whitespace_eater_unicode(self):
01934         eq = self.assertEqual
01935         s = '=?ISO-8859-1?Q?Andr=E9?= Pirard <pirard@dom.ain>'
01936         dh = decode_header(s)
01937         eq(dh, [(b'Andr\xe9', 'iso-8859-1'),
01938                 (b'Pirard <pirard@dom.ain>', None)])
01939         header = str(make_header(dh))
01940         eq(header, 'Andr\xe9 Pirard <pirard@dom.ain>')

Here is the call graph for this function:

Definition at line 1941 of file test_email.py.

01941 
01942     def test_whitespace_eater_unicode_2(self):
01943         eq = self.assertEqual
01944         s = 'The =?iso-8859-1?b?cXVpY2sgYnJvd24gZm94?= jumped over the =?iso-8859-1?b?bGF6eSBkb2c=?='
01945         dh = decode_header(s)
01946         eq(dh, [(b'The', None), (b'quick brown fox', 'iso-8859-1'),
01947                 (b'jumped over the', None), (b'lazy dog', 'iso-8859-1')])
01948         hu = str(make_header(dh))
01949         eq(hu, 'The quick brown fox jumped over the lazy dog')

Here is the call graph for this function:


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