Example #1
0
 def test_sentence_creates_sentence_of_given_length(self):
     """The sentence() function should generate sentences with the number of
     words equal to the number given in the 'words' argument."""
     for i in range(1, 127):
         my_sentence = sentence(i)
         self.assertEqual(len(my_sentence.split()), i)
Example #2
0
 def test_sentence_creates_sentence_of_average_length_with_no_argument(self):
     """When given no argument, sentence() should generate sentences between
     three and ten words long."""
     for i in range(127):
         my_sentence = sentence()
         self.assertTrue(10 >= len(my_sentence.split()) >= 3)