def test_words_with_quotes(self): """ Edge case that will break capitalization with first double quote. """ text = "\"You're despicable,\" said Daffy Duck" result = cap.just_do_it(text) self.assertEqual(result, "\"You're Despicable,\" Said Daffy Duck")
def test_one_word(self): """ Should capitalize test word 'duck' and return capitalized word, 'Duck'. """ text = 'duck' result = cap.just_do_it(text) self.assertEqual(result, 'Duck') # Expected result should match 'Duck'.
def test_words_with_apostrophes(self): """ Should capitalize test phrase 'I'm fresh out of ideas' and return capitalized phrase 'I'M FRESH OUT OF IDEAS.' """ text = "I'm fresh out of ideas" result = cap.just_do_it(text) self.assertEqual(result, "I'm Fresh Out Of Ideas")
def test_multiple_words(self): """ Should capitalize test phrase 'a veritable flock of ducks' and return capitalized phrase 'A Veritable Flock Of Ducks'. """ text = 'a veritable flock of ducks' result = cap.just_do_it(text) self.assertEqual(result, 'A Veritable Flock Of Ducks')
def test_words_with_apostrophes(): text = "I'm fresh out of ideas" result = cap.just_do_it(text) eq_(result, "I'm Fresh Out Of Ideas")
def test_multi_words(self): text = "a veritable flock of ducks" result = cap.just_do_it(text) self.assertEqual(result, "A Veritable Flock Of Ducks")
def test_multiple_words(self): text = 'a veritable flock of duck' result = cap.just_do_it(text) self.assertEqual(result, 'A Veritable Flock Of Duck')
def test_multiple_words(self): text = 'a veritable flock of ducks' result = cap.just_do_it(text) self.assertEqual(result, 'A Veritable Flock Of Ducks')
def test_words_with_quotes(self): text = "\"You're despicable,\" said Daffy Duck" result = cap.just_do_it(text) self.assertEqual(result, "\"You're Despicable,\" Said Daffy Duck")
def test_one_word(): text = 'duck' result = cap.just_do_it(text) eq_(result, 'Duck')
def test_words_with_more_upper(self): text = "\"You're desPICable,\" said Daffy Duck" result = cap.just_do_it(text) self.assertEqual(result, "\"You're Despicable,\" Said Daffy Duck")
def test_words_with_apostrophes(self): text = "I'm fresh out of ideas" result = cap.just_do_it(text) self.assertEqual(result, "I'm Fresh Out Of Ideas")
def test_None(self): text = None result = cap.just_do_it(text) self.assertEqual(result, None)
def test_with_quotes(self): '''测试带双引号的''' text = '"You\'re despicable ," said Daggy Duck' result = cap.just_do_it(text) self.assertEqual(result,'"You\'re Despicable ," Said Daggy Duck')
def test_words_with_quotes(): text = "\"You're despicable,\" said Daffy Duck" result = cap.just_do_it(text) eq_(result, "\"You're Despicable,\" Said Daffy Duck")
def test_one_word(): text = "duck" result = cap.just_do_it(text) eq_(result, "Duck")
def test_multiple_words(): '''测试连字符''' text = 'the most common relaxing procedure by women' result = cap.just_do_it(text) eq_(result, 'The Most Common Relaxing Procedure By Women')
def test_with_quotes(): '''测试带双引号的''' text = '"You\'re despicable ," said Daggy Duck' result = cap.just_do_it(text) eq_(result, '"You\'re Despicable ," Said Daggy Duck')
def test_multiple_words(): text = 'a veritable flock of ducks' result = cap.just_do_it(text) eq_(result, 'A Veritable Flock Of Ducks')
def test_one_word(): '''测试单字符''' text = 'Duck' result = cap.just_do_it(text) eq_(result, 'Duck')
def test_one_word(self): text = 'duck' result = cap.just_do_it(text) self.assertEqual(result, 'Duck')
def test_multiple_words(): text = "a veritable flock of ducks" result = cap.just_do_it(text) eq_(result, "A Veritable Flock Of Ducks")
def test_one_word(self): text = "duck" result = cap.just_do_it(text) self.assertEqual(result, "Duck")