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

Method test_init

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

Source from the content-addressed store, hash-verified

2134 self.assertEqual(c[key], 1)
2135
2136 def test_init(self):
2137 self.assertEqual(list(Counter(self=42).items()), [('self', 42)])
2138 self.assertEqual(list(Counter(iterable=42).items()), [('iterable', 42)])
2139 self.assertEqual(list(Counter(iterable=None).items()), [('iterable', None)])
2140 self.assertRaises(TypeError, Counter, 42)
2141 self.assertRaises(TypeError, Counter, (), ())
2142 self.assertRaises(TypeError, Counter.__init__)
2143
2144 def test_total(self):
2145 c = Counter(a=10, b=5, c=0)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected