Example #1
0
 def test_removes_trailing_whitespace(self):
     self.assertEqual(unify_case("test    "), "Test")
Example #2
0
 def test_removes_extra_whitespace_between_words(self):
     self.assertEqual(unify_case("test    case"), "Test Case")
Example #3
0
 def test_converts_dots_into_spaces(self):
     self.assertEqual(unify_case("test.case"), "Test Case")
Example #4
0
 def test_does_capitalize_special_cases_at_begin_of_string(self):
     for word in self.non_capital_words:
         self.assertEqual(unify_case(word), word.title())
Example #5
0
 def test_does_not_capitalize_special_cases_in_middle_of_string(self):
     for case, result in self.non_capital_words_cases:
         self.assertEqual(unify_case(case), result)
Example #6
0
 def test_only_first_letter_of_each_word_capitalized(self):
     self.assertEqual(unify_case("COMPLETE THIS TEST"), "Complete This Test")
Example #7
0
 def test_does_capitalize_first_letter_of_each_word(self):
     self.assertEqual(unify_case("complete this test"), "Complete This Test")