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

Method test_data

Lib/test/test_userdict.py:168–185  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

166 self.assertRaises(TypeError, collections.UserDict.__init__)
167
168 def test_data(self):
169 u = UserDict()
170 self.assertEqual(u.data, {})
171 self.assertIs(type(u.data), dict)
172 d = {'a': 1, 'b': 2}
173 u = UserDict(d)
174 self.assertEqual(u.data, d)
175 self.assertIsNot(u.data, d)
176 self.assertIs(type(u.data), dict)
177 u = UserDict(u)
178 self.assertEqual(u.data, d)
179 self.assertIs(type(u.data), dict)
180 u = UserDict([('a', 1), ('b', 2)])
181 self.assertEqual(u.data, d)
182 self.assertIs(type(u.data), dict)
183 u = UserDict(a=1, b=2)
184 self.assertEqual(u.data, d)
185 self.assertIs(type(u.data), dict)
186
187 def test_update(self):
188 for kw in 'self', 'dict', 'other', 'iterable':

Callers

nothing calls this directly

Calls 4

UserDictClass · 0.90
assertIsNotMethod · 0.80
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected