Back to index

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

List of all members.

Public Member Functions

def test_decode_with_string_map

Detailed Description

Definition at line 1520 of file test_codecs.py.


Member Function Documentation

Definition at line 1521 of file test_codecs.py.

01521 
01522     def test_decode_with_string_map(self):
01523         self.assertEqual(
01524             codecs.charmap_decode(b"\x00\x01\x02", "strict", "abc"),
01525             ("abc", 3)
01526         )
01527 
01528         self.assertEqual(
01529             codecs.charmap_decode(b"\x00\x01\x02", "replace", "ab"),
01530             ("ab\ufffd", 3)
01531         )
01532 
01533         self.assertEqual(
01534             codecs.charmap_decode(b"\x00\x01\x02", "replace", "ab\ufffe"),
01535             ("ab\ufffd", 3)
01536         )
01537 
01538         self.assertEqual(
01539             codecs.charmap_decode(b"\x00\x01\x02", "ignore", "ab"),
01540             ("ab", 3)
01541         )
01542 
01543         self.assertEqual(
01544             codecs.charmap_decode(b"\x00\x01\x02", "ignore", "ab\ufffe"),
01545             ("ab", 3)
01546         )
01547 
01548         allbytes = bytes(range(256))
01549         self.assertEqual(
01550             codecs.charmap_decode(allbytes, "ignore", ""),
01551             ("", len(allbytes))
01552         )

Here is the call graph for this function:


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