def test_step1_convert_word_list_spaces(self):
     words = word_processor.convert_to_word_list('one  two     ')
     self.assertEqual(['one', 'two'], words)
Example #2
0
 def test_convert_to_word_list(self):
     results = word_processor.convert_to_word_list(
         "Hello; How, you doing? Its been long.")
     self.assertEqual(
         ['hello', 'how', 'you', 'doing', 'its', 'been', 'long'], results)
 def test_step1_convert_word_list_empty(self):
     words = word_processor.convert_to_word_list('')
     self.assertEqual([], words)
Example #4
0
 def test_word_split(self):
     words = "These are indeed interesting, an obvious understatement, times. What say you?"
     self.assertTrue(word_processor.convert_to_word_list(words), True)
 def test_step1_convert_word_list_1(self):
     words = word_processor.convert_to_word_list(
         'These are indeed interesting, an obvious understatement, times. What say you?')
     self.assertEqual(
         ['these', 'are', 'indeed', 'interesting', 'an', 'obvious', 'understatement', 'times', 'what', 'say', 'you'],
         words)
Example #6
0
 def test_convert_punctuation_spaces_caps(self):
     self.assertEqual(
         convert_to_word_list("So.What,          have we here?"),
         ['so', 'what', 'have', 'we', 'here'])
Example #7
0
 def test_convert_empty(self):
     self.assertEqual(convert_to_word_list(""), [])
Example #8
0
 def test_convert_digit(self):
     self.assertEqual(convert_to_word_list(1234), -1)
 def test_converts_to_lowercase(self):
     """tests if the convert_to_word_list function converts a string into a list of lowercased words"""
     result = word_processor.convert_to_word_list(
         "ONCE A LifeTime Twice A DAY")
     expect = ['once', 'a', 'lifetime', 'twice', 'a', 'day']
     self.assertEqual(expect, result)
Example #10
0
 def test_convert_to_list(self):
     result = word_processor.convert_to_word_list('')
     self.assertTrue(
         result,
         "['these', 'are', 'indeed', 'interesting', 'an', 'obvious', 'understatement', 'times', 'what', 'say', 'you']"
     )