(self)
| 2352 | self.assertIn("'b': None", r) |
| 2353 | |
| 2354 | def test_helper_function(self): |
| 2355 | # two paths, one for real dicts and one for other mappings |
| 2356 | elems = list('abracadabra') |
| 2357 | |
| 2358 | d = dict() |
| 2359 | _count_elements(d, elems) |
| 2360 | self.assertEqual(d, {'a': 5, 'r': 2, 'b': 2, 'c': 1, 'd': 1}) |
| 2361 | |
| 2362 | m = OrderedDict() |
| 2363 | _count_elements(m, elems) |
| 2364 | self.assertEqual(m, |
| 2365 | OrderedDict([('a', 5), ('b', 2), ('r', 2), ('c', 1), ('d', 1)])) |
| 2366 | |
| 2367 | # test fidelity to the pure python version |
| 2368 | c = CounterSubclassWithSetItem('abracadabra') |
| 2369 | self.assertTrue(c.called) |
| 2370 | self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 }) |
| 2371 | c = CounterSubclassWithGet('abracadabra') |
| 2372 | self.assertTrue(c.called) |
| 2373 | self.assertEqual(dict(c), {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r':2 }) |
| 2374 | |
| 2375 | def test_multiset_operations_equivalent_to_set_operations(self): |
| 2376 | # When the multiplicities are all zero or one, multiset operations |
nothing calls this directly
no test coverage detected