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

Method testIsSorted

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

Source from the content-addressed store, hash-verified

247 self.assertEqual(list(r), ['b', 'c', 'a'])
248
249 def testIsSorted(self):
250 r = markdown.util.Registry()
251 self.assertIs(r._is_sorted, False)
252 r.register(Item('a'), 'a', 20)
253 list(r)
254 self.assertIs(r._is_sorted, True)
255 r.register(Item('b'), 'b', 21)
256 self.assertIs(r._is_sorted, False)
257 r['a']
258 self.assertIs(r._is_sorted, True)
259 r._is_sorted = False
260 r.get_index_for_name('a')
261 self.assertIs(r._is_sorted, True)
262 r._is_sorted = False
263 repr(r)
264 self.assertIs(r._is_sorted, True)
265
266 def testDeregister(self):
267 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