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

Method testIsSorted

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

Source from the content-addressed store, hash-verified

271 self.assertEqual(list(r), ['b', 'c', 'a'])
272
273 def testIsSorted(self):
274 r = markdown.util.Registry()
275 self.assertIs(r._is_sorted, False)
276 r.register(Item('a'), 'a', 20)
277 list(r)
278 self.assertIs(r._is_sorted, True)
279 r.register(Item('b'), 'b', 21)
280 self.assertIs(r._is_sorted, False)
281 r['a']
282 self.assertIs(r._is_sorted, True)
283 r._is_sorted = False
284 r.get_index_for_name('a')
285 self.assertIs(r._is_sorted, True)
286 r._is_sorted = False
287 repr(r)
288 self.assertIs(r._is_sorted, True)
289
290 def testDeregister(self):
291 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