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