MCPcopy Index your code
hub / github.com/python/cpython / test_find_with_namespace

Method test_find_with_namespace

Lib/test/test_xml_etree.py:4031–4037  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4029
4030class NamespaceParseTest(unittest.TestCase):
4031 def test_find_with_namespace(self):
4032 nsmap = {'h': 'hello', 'f': 'foo'}
4033 doc = ET.fromstring(SAMPLE_XML_NS_ELEMS)
4034
4035 self.assertEqual(len(doc.findall('{hello}table', nsmap)), 1)
4036 self.assertEqual(len(doc.findall('.//{hello}td', nsmap)), 2)
4037 self.assertEqual(len(doc.findall('.//{foo}name', nsmap)), 1)
4038
4039
4040class ElementSlicingTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

fromstringMethod · 0.45
assertEqualMethod · 0.45
findallMethod · 0.45

Tested by

no test coverage detected