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