[Python-checkins] python/dist/src/Lib/test test_xmllib.py, 1.11, 1.12

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun May 2 16:37:15 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1753/Lib/test

Modified Files:
	test_xmllib.py 
Log Message:
Do not use the default namespace for attributes. 
Fixes http://bugs.debian.org/229885
Will backport to 2.3.


Index: test_xmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_xmllib.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_xmllib.py	23 Jul 2002 19:04:09 -0000	1.11
--- test_xmllib.py	2 May 2004 20:37:13 -0000	1.12
***************
*** 14,17 ****
--- 14,19 ----
  """
  
+ nsdoc = "<foo xmlns='URI' attr='val'/>"
+ 
  import warnings
  warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
***************
*** 30,33 ****
--- 32,47 ----
          parser.close()
  
+     def test_default_namespace(self):
+         class H(xmllib.XMLParser):
+             def unknown_starttag(self, name, attr):
+                 self.name, self.attr = name, attr
+         h=H()
+         h.feed(nsdoc)
+         h.close()
+         # The default namespace applies to elements...
+         self.assertEquals(h.name, "URI foo")
+         # but not to attributes
+         self.assertEquals(h.attr, {'attr':'val'})
+ 
  
  def test_main():




More information about the Python-checkins mailing list