Example #1
0
 def test_returns_blank_for_empty(self):
   self.assertDictEqual(dict(occurrences("")), {})
Example #2
0
 def test_missing_element_count_is_0(self):
   d = occurrences('aaaaa')
   self.assertEqual(d['c'], 0)
Example #3
0
 def test_returns_multiset(self):
   self.assertDictEqual(dict(occurrences('aaaaabbbccc')),
       {'a': 5, 'b': 3, 'c': 3})
Example #4
0
 def test_returns_multiset(self):
   self.assertDictEqual(dict(functional.occurrences("aaaaabbbccc")),
       {"a": 5, "b": 3, "c": 3})
Example #5
0
 def test_missing_element_count_is_0(self):
   d = functional.occurrences("aaaaa")
   self.assertEqual(d["c"], 0)
Example #6
0
 def test_returns_blank_for_empty(self):
   self.assertDictEqual(dict(functional.occurrences("")), {})
Example #7
0
 def test_returns_multiset(self):
   self.assertDictEqual(dict(functional.occurrences("aaaaabbbccc")),
       {"a": 5, "b": 3, "c": 3})
Example #8
0
 def test_missing_element_count_is_0(self):
   d = functional.occurrences("aaaaa")
   self.assertEqual(d["c"], 0)