def test_split_words_with_underscores(self): self.assertEqual(['one', 'two', 'three'], misspellings.split_words('one_two_three')) self.assertEqual(['one', 'two', 'three'], misspellings.split_words('one__two__three')) self.assertEqual(['one', 'two', 'three', 'four'], misspellings.split_words('one_two_three four'))
def test_split_words_with_camel_case(self): self.assertEqual(['one', 'Two', 'Three'], misspellings.split_words('oneTwoThree')) self.assertEqual(['one', 'Two', 'Three', 'Four'], misspellings.split_words('oneTwoThreeFour')) self.assertEqual(['one', 'Two', 'Three', 'four'], misspellings.split_words('oneTwoThree_four')) self.assertEqual(['one', 'Two', 'Three', 'four', 'five'], misspellings.split_words('oneTwoThree_four five')) self.assertEqual(['foo', 'Up', 'To', 'Bar'], misspellings.split_words('fooUpToBar'))
def test_split_words_with_numbers(self): self.assertEqual(['upper', 'lower'], misspellings.split_words('upper2lower'))
def test_split_words_with_punctuation(self): self.assertEqual(['one', 'two'], misspellings.split_words('one, two')) self.assertEqual(['a', 'sentence', ''], misspellings.split_words('a sentence.'))
def test_split_words(self): self.assertEqual(['one', 'two', 'three'], misspellings.split_words('one two three'))
def test_split_words_with_other_characters(self): self.assertEqual(['the', 'big', 'cat'], misspellings.split_words('the%big$cat'))