Permalink
Browse files

[svn r4454] disable test for ET that fails in Py3

--HG--
branch : trunk
  • Loading branch information...
1 parent b8b22b2 commit ad4241b9e76f3127277dbcb256cfe9d761dd3110 scoder committed Aug 8, 2010
Showing with 15 additions and 14 deletions.
  1. +0 −14 src/lxml/tests/test_elementtree.py
  2. +15 −0 src/lxml/tests/test_etree.py
@@ -526,20 +526,6 @@ def test_attribute_str(self):
except AssertionError:
self.assertEquals(alternative, str(root.attrib))
- def test_attribute_has_key(self):
- XML = self.etree.XML
-
- root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />'))
- self.assertEquals(
- True, root.attrib.has_key('bar'))
- self.assertEquals(
- False, root.attrib.has_key('baz'))
- self.assertEquals(
- False, root.attrib.has_key('hah'))
- self.assertEquals(
- True,
- root.attrib.has_key('{http://ns.codespeak.net/test}baz'))
-
def test_attribute_contains(self):
XML = self.etree.XML
@@ -207,6 +207,21 @@ def test_nsmap_prefix_invalid(self):
self.assertRaises(ValueError,
etree.Element, "root", nsmap={'a:b' : 'testns'})
+ def test_attribute_has_key(self):
+ # ET in Py 3.x has no "attrib.has_key()" method
+ XML = self.etree.XML
+
+ root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />'))
+ self.assertEquals(
+ True, root.attrib.has_key('bar'))
+ self.assertEquals(
+ False, root.attrib.has_key('baz'))
+ self.assertEquals(
+ False, root.attrib.has_key('hah'))
+ self.assertEquals(
+ True,
+ root.attrib.has_key('{http://ns.codespeak.net/test}baz'))
+
def test_attribute_set(self):
Element = self.etree.Element
root = Element("root")

0 comments on commit ad4241b

Please sign in to comment.