Back to index

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

List of all members.

Public Member Functions

def test_nameprep

Detailed Description

Definition at line 1097 of file

Member Function Documentation

Definition at line 1098 of file

01099     def test_nameprep(self):
01100         from encodings.idna import nameprep
01101         for pos, (orig, prepped) in enumerate(nameprep_tests):
01102             if orig is None:
01103                 # Skipped
01104                 continue
01105             # The Unicode strings are given in UTF-8
01106             orig = str(orig, "utf-8", "surrogatepass")
01107             if prepped is None:
01108                 # Input contains prohibited characters
01109                 self.assertRaises(UnicodeError, nameprep, orig)
01110             else:
01111                 prepped = str(prepped, "utf-8", "surrogatepass")
01112                 try:
01113                     self.assertEqual(nameprep(orig), prepped)
01114                 except Exception as e:
01115                     raise support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))

Here is the call graph for this function:

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