Back to index

python3.2  3.2.2
Public Member Functions
test.test_codecs.TypesTest Class Reference

List of all members.

Public Member Functions

def test_decode_unicode
def test_unicode_escape

Detailed Description

Definition at line 1566 of file test_codecs.py.


Member Function Documentation

Definition at line 1567 of file test_codecs.py.

01567 
01568     def test_decode_unicode(self):
01569         # Most decoders don't accept unicode input
01570         decoders = [
01571             codecs.utf_7_decode,
01572             codecs.utf_8_decode,
01573             codecs.utf_16_le_decode,
01574             codecs.utf_16_be_decode,
01575             codecs.utf_16_ex_decode,
01576             codecs.utf_32_decode,
01577             codecs.utf_32_le_decode,
01578             codecs.utf_32_be_decode,
01579             codecs.utf_32_ex_decode,
01580             codecs.latin_1_decode,
01581             codecs.ascii_decode,
01582             codecs.charmap_decode,
01583         ]
01584         if hasattr(codecs, "mbcs_decode"):
01585             decoders.append(codecs.mbcs_decode)
01586         for decoder in decoders:
01587             self.assertRaises(TypeError, decoder, "xxx")

Here is the call graph for this function:

Definition at line 1588 of file test_codecs.py.

01588 
01589     def test_unicode_escape(self):
01590         # Escape-decoding an unicode string is supported ang gives the same
01591         # result as decoding the equivalent ASCII bytes string.
01592         self.assertEqual(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6))
01593         self.assertEqual(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6))
01594         self.assertEqual(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6))
01595         self.assertEqual(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6))

Here is the call graph for this function:


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