Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes
email.test.test_email.TestMIMEText Class Reference

List of all members.

Public Member Functions

def setUp
def test_types
def test_payload
def test_charset
def test_7bit_input
def test_7bit_input_no_charset
def test_utf8_input
def test_utf8_input_no_charset

Private Attributes

 _msg

Detailed Description

Definition at line 1371 of file test_email.py.


Member Function Documentation

Definition at line 1372 of file test_email.py.

01372 
01373     def setUp(self):
01374         self._msg = MIMEText('hello there')

Here is the caller graph for this function:

Definition at line 1395 of file test_email.py.

01395 
01396     def test_7bit_input(self):
01397         eq = self.assertEqual
01398         msg = MIMEText('hello there', _charset='us-ascii')
01399         eq(msg.get_charset().input_charset, 'us-ascii')
01400         eq(msg['content-type'], 'text/plain; charset="us-ascii"')

Here is the call graph for this function:

Definition at line 1401 of file test_email.py.

01401 
01402     def test_7bit_input_no_charset(self):
01403         eq = self.assertEqual
01404         msg = MIMEText('hello there')
01405         eq(msg.get_charset(), 'us-ascii')
01406         eq(msg['content-type'], 'text/plain; charset="us-ascii"')
01407         self.assertTrue('hello there' in msg.as_string())

Here is the call graph for this function:

Definition at line 1389 of file test_email.py.

01389 
01390     def test_charset(self):
01391         eq = self.assertEqual
01392         msg = MIMEText('hello there', _charset='us-ascii')
01393         eq(msg.get_charset().input_charset, 'us-ascii')
01394         eq(msg['content-type'], 'text/plain; charset="us-ascii"')

Here is the call graph for this function:

Definition at line 1385 of file test_email.py.

01385 
01386     def test_payload(self):
01387         self.assertEqual(self._msg.get_payload(), 'hello there')
01388         self.assertTrue(not self._msg.is_multipart())

Here is the call graph for this function:

Definition at line 1375 of file test_email.py.

01375 
01376     def test_types(self):
01377         eq = self.assertEqual
01378         unless = self.assertTrue
01379         eq(self._msg.get_content_type(), 'text/plain')
01380         eq(self._msg.get_param('charset'), 'us-ascii')
01381         missing = []
01382         unless(self._msg.get_param('foobar', missing) is missing)
01383         unless(self._msg.get_param('charset', missing, header='foobar')
01384                is missing)

Here is the call graph for this function:

Definition at line 1408 of file test_email.py.

01408 
01409     def test_utf8_input(self):
01410         teststr = '\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430'
01411         eq = self.assertEqual
01412         msg = MIMEText(teststr, _charset='utf-8')
01413         eq(msg.get_charset().output_charset, 'utf-8')
01414         eq(msg['content-type'], 'text/plain; charset="utf-8"')
01415         eq(msg.get_payload(decode=True), teststr.encode('utf-8'))

Here is the call graph for this function:

Definition at line 1418 of file test_email.py.

01418 
01419     def test_utf8_input_no_charset(self):
01420         teststr = '\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430'
01421         self.assertRaises(UnicodeEncodeError, MIMEText, teststr)
01422 
01423 
01424 
# Test complicated multipart/* messages

Here is the call graph for this function:


Member Data Documentation

Definition at line 1373 of file test_email.py.


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