示例#1
0
文件: tests.py 项目: kymerror/zantext
 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)
示例#2
0
文件: tests.py 项目: kymerror/zantext
 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)