MCPcopy Index your code
hub / github.com/python/cpython / test_ordereddict

Method test_ordereddict

Lib/test/test_json/test_default.py:29–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 'when serializing type object'])
28
29 def test_ordereddict(self):
30 od = collections.OrderedDict(a=1, b=2, c=3, d=4)
31 od.move_to_end('b')
32 self.assertEqual(
33 self.dumps(od),
34 '{"a": 1, "c": 3, "d": 4, "b": 2}')
35 self.assertEqual(
36 self.dumps(od, sort_keys=True),
37 '{"a": 1, "b": 2, "c": 3, "d": 4}')
38
39
40class TestPyDefault(TestDefault, PyTest): pass

Callers

nothing calls this directly

Calls 3

move_to_endMethod · 0.95
assertEqualMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected