[Python-checkins] CVS: python/dist/src/Lib/test test_pyexpat.py,1.7,1.8
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 25 Apr 2001 09:03:56 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv18120
Modified Files:
test_pyexpat.py
Log Message:
Update test to accomodate the change to the namespace_separator parameter
of ParserCreate().
Added assignment tests for the ordered_attributes and specified_attributes
values, similar to the checks for the returns_unicode attribute.
Index: test_pyexpat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pyexpat.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_pyexpat.py 2000/12/23 22:12:07 1.7
--- test_pyexpat.py 2001/04/25 16:03:54 1.8
***************
*** 76,79 ****
--- 76,91 ----
parser.returns_unicode = 0; confirm(parser.returns_unicode == 0)
+ # Test getting/setting ordered_attributes
+ parser.ordered_attributes = 0; confirm(parser.ordered_attributes == 0)
+ parser.ordered_attributes = 1; confirm(parser.ordered_attributes == 1)
+ parser.ordered_attributes = 2; confirm(parser.ordered_attributes == 1)
+ parser.ordered_attributes = 0; confirm(parser.ordered_attributes == 0)
+
+ # Test getting/setting specified_attributes
+ parser.specified_attributes = 0; confirm(parser.specified_attributes == 0)
+ parser.specified_attributes = 1; confirm(parser.specified_attributes == 1)
+ parser.specified_attributes = 2; confirm(parser.specified_attributes == 1)
+ parser.specified_attributes = 0; confirm(parser.specified_attributes == 0)
+
HANDLER_NAMES = [
'StartElementHandler', 'EndElementHandler',
***************
*** 168,171 ****
--- 180,184 ----
else:
print "Failed to catch expected TypeError."
+
try:
expat.ParserCreate(namespace_separator='too long')
***************
*** 175,183 ****
else:
print "Failed to catch expected ValueError."
! try:
! expat.ParserCreate(namespace_separator='') # too short
! except ValueError, e:
! print "Caught expected ValueError:"
! print e
! else:
! print "Failed to catch expected ValueError."
--- 188,199 ----
else:
print "Failed to catch expected ValueError."
!
! # ParserCreate() needs to accept a namespace_separator of zero length
! # to satisfy the requirements of RDF applications that are required
! # to simply glue together the namespace URI and the localname. Though
! # considered a wart of the RDF specifications, it needs to be supported.
! #
! # See XML-SIG mailing list thread starting with
! # http://mail.python.org/pipermail/xml-sig/2001-April/005202.html
! #
! expat.ParserCreate(namespace_separator='') # too short