MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / testGetIndexForName

Method testGetIndexForName

tests/test_apis.py:365–372  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

363 self.assertEqual(list(slc), ['b', 'a'])
364
365 def testGetIndexForName(self):
366 r = markdown.util.Registry()
367 r.register(Item('a'), 'a', 20)
368 r.register(Item('b'), 'b', 30)
369 self.assertEqual(r.get_index_for_name('a'), 1)
370 self.assertEqual(r.get_index_for_name('b'), 0)
371 with self.assertRaises(ValueError):
372 r.get_index_for_name('c')
373
374 def testRegisterDupplicate(self):
375 r = markdown.util.Registry()

Callers

nothing calls this directly

Calls 3

registerMethod · 0.95
get_index_for_nameMethod · 0.95
ItemClass · 0.85

Tested by

no test coverage detected