MCPcopy
hub / github.com/Python-Markdown/markdown / testGetIndexForName

Method testGetIndexForName

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

Source from the content-addressed store, hash-verified

339 self.assertEqual(list(slc), ['b', 'a'])
340
341 def testGetIndexForName(self):
342 r = markdown.util.Registry()
343 r.register(Item('a'), 'a', 20)
344 r.register(Item('b'), 'b', 30)
345 self.assertEqual(r.get_index_for_name('a'), 1)
346 self.assertEqual(r.get_index_for_name('b'), 0)
347 with self.assertRaises(ValueError):
348 r.get_index_for_name('c')
349
350 def testRegisterDupplicate(self):
351 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