Back to index

python3.2  3.2.2
Public Member Functions
test.test_pyexpat.NamespaceSeparatorTest Class Reference

List of all members.

Public Member Functions

def test_legal
def test_illegal
def test_zero_length

Detailed Description

Definition at line 228 of file test_pyexpat.py.


Member Function Documentation

Definition at line 236 of file test_pyexpat.py.

00236 
00237     def test_illegal(self):
00238         try:
00239             expat.ParserCreate(namespace_separator=42)
00240             self.fail()
00241         except TypeError as e:
00242             self.assertEqual(str(e),
00243                 'ParserCreate() argument 2 must be str or None, not int')
00244 
00245         try:
00246             expat.ParserCreate(namespace_separator='too long')
00247             self.fail()
00248         except ValueError as e:
00249             self.assertEqual(str(e),
00250                 'namespace_separator must be at most one character, omitted, or None')

Here is the call graph for this function:

Definition at line 229 of file test_pyexpat.py.

00229 
00230     def test_legal(self):
00231         # Tests that make sure we get errors when the namespace_separator value
00232         # is illegal, and that we don't for good values:
00233         expat.ParserCreate()
00234         expat.ParserCreate(namespace_separator=None)
00235         expat.ParserCreate(namespace_separator=' ')

Definition at line 251 of file test_pyexpat.py.

00251 
00252     def test_zero_length(self):
00253         # ParserCreate() needs to accept a namespace_separator of zero length
00254         # to satisfy the requirements of RDF applications that are required
00255         # to simply glue together the namespace URI and the localname.  Though
00256         # considered a wart of the RDF specifications, it needs to be supported.
00257         #
00258         # See XML-SIG mailing list thread starting with
00259         # http://mail.python.org/pipermail/xml-sig/2001-April/005202.html
00260         #
00261         expat.ParserCreate(namespace_separator='') # too short
00262 


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