Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_codecmaps_tw.TestBIG5Map Class Reference
Inheritance diagram for test.test_codecmaps_tw.TestBIG5Map:
Inheritance graph
[legend]
Collaboration diagram for test.test_codecmaps_tw.TestBIG5Map:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def open_mapping_file
def test_mapping_file
def test_mapping_supplemental
def test_errorhandle

Static Public Attributes

string encoding = 'big5'
string mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/'
list pass_enctest = []
list pass_dectest = []
list supmaps = []
list codectests = []

Detailed Description

Definition at line 12 of file test_codecmaps_tw.py.


Member Function Documentation

Definition at line 296 of file test_multibytecodec_support.py.

00296 
00297     def open_mapping_file(self):
00298         return support.open_urlresource(self.mapfileurl)

Here is the caller graph for this function:

Definition at line 357 of file test_multibytecodec_support.py.

00357 
00358     def test_errorhandle(self):
00359         for source, scheme, expected in self.codectests:
00360             if isinstance(source, bytes):
00361                 func = source.decode
00362             else:
00363                 func = source.encode
00364             if expected:
00365                 if isinstance(source, bytes):
00366                     result = func(self.encoding, scheme)
00367                     self.assertTrue(type(result) is str, type(result))
00368                     self.assertEqual(result, expected,
00369                                      '%a.decode(%r, %r)=%a != %a'
00370                                      % (source, self.encoding, scheme, result,
00371                                         expected))
00372                 else:
00373                     result = func(self.encoding, scheme)
00374                     self.assertTrue(type(result) is bytes, type(result))
00375                     self.assertEqual(result, expected,
00376                                      '%a.encode(%r, %r)=%a != %a'
00377                                      % (source, self.encoding, scheme, result,
00378                                         expected))
00379             else:
00380                 self.assertRaises(UnicodeError, func, self.encoding, scheme)

Here is the call graph for this function:

Definition at line 299 of file test_multibytecodec_support.py.

00299 
00300     def test_mapping_file(self):
00301         if self.mapfileurl.endswith('.xml'):
00302             self._test_mapping_file_ucm()
00303         else:
00304             self._test_mapping_file_plain()

Here is the call graph for this function:

Definition at line 347 of file test_multibytecodec_support.py.

00347 
00348     def test_mapping_supplemental(self):
00349         for mapping in self.supmaps:
00350             self._testpoint(*mapping)

Here is the call graph for this function:


Member Data Documentation

Definition at line 287 of file test_multibytecodec_support.py.

Definition at line 13 of file test_codecmaps_tw.py.

string test.test_codecmaps_tw.TestBIG5Map.mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' [static]

Definition at line 14 of file test_codecmaps_tw.py.

Reimplemented in test.test_codecmaps_jp.TestCP932Map.

Definition at line 286 of file test_multibytecodec_support.py.


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