(self)
| 2375 | self.assertIn("'b': None", r) |
| 2376 | |
| 2377 | def test_helper_function(self): |
| 2378 | # two paths, one for real dicts and one for other mappings |
| 2379 | elems = list('abracadabra') |
| 2380 | |
| 2381 | d = dict() |
| 2382 | _count_elements(d, elems) |
| 2383 | self.assertEqual(d, {'a': 5, 'r': 2, 'b': 2, 'c': 1, 'd': 1}) |
| 2384 | |
| 2385 | m = OrderedDict() |
| 2386 | _count_elements(m, elems) |
| 2387 | self.assertEqual(m, |
| 2388 | OrderedDict([('a', 5), ('b', 2), ('r', 2), ('c', 1), ('d', 1)])) |
| 2389 | |
| 2390 | # test fidelity to the pure python version |
| 2391 | c = CounterSubclassWithSetItem('abracadabra') |
| 2392 | self.assertTrue(c.called) |
| 2393 | self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 }) |
| 2394 | c = CounterSubclassWithGet('abracadabra') |
| 2395 | self.assertTrue(c.called) |
| 2396 | self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 }) |
| 2397 | |
| 2398 | def test_multiset_operations_equivalent_to_set_operations(self): |
| 2399 | # When the multiplicities are all zero or one, multiset operations |
nothing calls this directly
no test coverage detected