MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_update

Method test_update

Lib/test/test_collections.py:2205–2217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2203 self.assertTrue(correctly_ordered(p))
2204
2205 def test_update(self):
2206 c = Counter()
2207 c.update(self=42)
2208 self.assertEqual(list(c.items()), [('self', 42)])
2209 c = Counter()
2210 c.update(iterable=42)
2211 self.assertEqual(list(c.items()), [('iterable', 42)])
2212 c = Counter()
2213 c.update(iterable=None)
2214 self.assertEqual(list(c.items()), [('iterable', None)])
2215 self.assertRaises(TypeError, Counter().update, 42)
2216 self.assertRaises(TypeError, Counter().update, {}, {})
2217 self.assertRaises(TypeError, Counter.update)
2218
2219 def test_copying(self):
2220 # Check that counters are copyable, deepcopyable, picklable, and

Callers

nothing calls this directly

Calls 6

updateMethod · 0.95
CounterClass · 0.90
listClass · 0.85
assertEqualMethod · 0.45
itemsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected