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

Method test_items

Lib/test/test_dict.py:110–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

108 self.assertEqual(repr(dict(a=1).values()), "dict_values([1])")
109
110 def test_items(self):
111 d = {}
112 self.assertEqual(set(d.items()), set())
113
114 d = {1:2}
115 self.assertEqual(set(d.items()), {(1, 2)})
116 self.assertRaises(TypeError, d.items, None)
117 self.assertEqual(repr(dict(a=1).items()), "dict_items([('a', 1)])")
118
119 def test_views_mapping(self):
120 mappingproxy = type(type.__dict__)

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
assertEqualMethod · 0.45
itemsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected