MCPcopy Create free account
hub / github.com/sissaschool/xmlschema / test_xpath_api

Method test_xpath_api

tests/test_dataobjects.py:187–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

185 self.assertEqual(data_element[0].tag, 'elem1')
186
187 def test_xpath_api(self):
188 col_data = self.col_schema.decode(self.col_xml_filename)
189
190 self.assertIs(col_data.find('.'), col_data)
191 self.assertIs(col_data.find('*'), col_data[0])
192 self.assertIs(col_data.find('object[2]'), col_data[1])
193
194 self.assertListEqual(col_data.findall('*'), col_data[:])
195 self.assertListEqual(list(col_data.iterfind('*')), col_data[:])
196
197 def test_iter(self):
198 col_data = self.col_schema.decode(self.col_xml_filename)

Callers

nothing calls this directly

Calls 4

decodeMethod · 0.45
findMethod · 0.45
findallMethod · 0.45
iterfindMethod · 0.45

Tested by

no test coverage detected