MCPcopy Create free account
hub / github.com/python/cpython / test_move_to_end_issue25406

Method test_move_to_end_issue25406

Lib/test/test_ordered_dict.py:455–467  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

453 od.move_to_end('x', False)
454
455 def test_move_to_end_issue25406(self):
456 OrderedDict = self.OrderedDict
457 od = OrderedDict.fromkeys('abc')
458 od.move_to_end('c', last=False)
459 self.assertEqual(list(od), list('cab'))
460 od.move_to_end('a', last=False)
461 self.assertEqual(list(od), list('acb'))
462
463 od = OrderedDict.fromkeys('abc')
464 od.move_to_end('a')
465 self.assertEqual(list(od), list('bca'))
466 od.move_to_end('c')
467 self.assertEqual(list(od), list('bac'))
468
469 def test_sizeof(self):
470 OrderedDict = self.OrderedDict

Callers

nothing calls this directly

Calls 4

listClass · 0.85
move_to_endMethod · 0.80
fromkeysMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected