Beispiel #1
0
 def test_string_with_four_words_two_equal_returns_the_correct_list(self):
     self.assertEqual(solution('a a b b'), ([('a', 2), ('b', 2)], [('a', 2), ('b', 2)]))
Beispiel #2
0
 def test_string_with_two_differents_words_returns_two_different_words_with_same_count(self):
     self.assertEqual(solution('a b'), ([('a', 1), ('b', 1)], [('a', 1), ('b', 1)]))
Beispiel #3
0
 def test_string_with_three_words_one_different_and_two_equal_returns_the_correct_list(self):
     self.assertEqual(solution('a a b'), ([('b', 1), ('a', 2)], [('a', 2), ('b', 1)]))
Beispiel #4
0
 def test_string_with_one_word_returns_same_word_as_least_and_most_common_4(self):
     self.assertEqual(solution('aa'), ([('aa', 1)], [('aa', 1)]))
Beispiel #5
0
 def test_string_with_three_equal_words_returns_same_word_as_least_and_most_common(self):
     self.assertEqual(solution('a a a'), ([('a', 3)], [('a', 3)]))
Beispiel #6
0
 def test_string_with_four_words_two_equal_returns_the_correct_list(self):
     self.assertEqual(solution('a a b b'),
                      ([('a', 2), ('b', 2)], [('a', 2), ('b', 2)]))
Beispiel #7
0
 def test_empty_string_returns_empty_tuple(self):
     self.assertEqual(solution(''), ([], []))
Beispiel #8
0
 def test_string_with_three_words_one_different_and_two_equal_returns_the_correct_list(
         self):
     self.assertEqual(solution('a a b'), ([('b', 1), ('a', 2)], [('a', 2),
                                                                 ('b', 1)]))
Beispiel #9
0
 def test_string_with_two_differents_words_returns_two_different_words_with_same_count(
         self):
     self.assertEqual(solution('a b'), ([('a', 1), ('b', 1)], [('a', 1),
                                                               ('b', 1)]))
Beispiel #10
0
 def test_string_with_three_equal_words_returns_same_word_as_least_and_most_common(
         self):
     self.assertEqual(solution('a a a'), ([('a', 3)], [('a', 3)]))
Beispiel #11
0
 def test_string_with_one_word_returns_same_word_as_least_and_most_common_4(
         self):
     self.assertEqual(solution('aa'), ([('aa', 1)], [('aa', 1)]))
Beispiel #12
0
 def test_empty_string_returns_empty_tuple(self):
     self.assertEqual(solution(''), ([], []))