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

Method test_conversions

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

Source from the content-addressed store, hash-verified

2266 self.assertEqual(type(d), type(c))
2267
2268 def test_conversions(self):
2269 # Convert to: set, list, dict
2270 s = 'she sells sea shells by the sea shore'
2271 self.assertEqual(sorted(Counter(s).elements()), sorted(s))
2272 self.assertEqual(sorted(Counter(s)), sorted(set(s)))
2273 self.assertEqual(dict(Counter(s)), dict(Counter(s).items()))
2274 self.assertEqual(set(Counter(s)), set(s))
2275
2276 def test_invariant_for_the_in_operator(self):
2277 c = Counter(a=10, b=-2, c=0)

Callers

nothing calls this directly

Calls 5

CounterClass · 0.90
setFunction · 0.85
elementsMethod · 0.80
assertEqualMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected