Skip to content

Commit

Permalink
[svn r4454] disable test for ET that fails in Py3
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
scoder committed Aug 8, 2010
1 parent b8b22b2 commit ad4241b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/lxml/tests/test_elementtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions src/lxml/tests/test_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ad4241b

Please sign in to comment.