def test_length(self): self.assertEqual(len(next(random_stories_generator(self.story))), 5) self.assertEqual( len(next(random_stories_generator(self.story, length=3))), 3) self.assertEqual( len(next(random_stories_generator(self.story, length=6))), 6) self.assertEqual(len(next(random_stories_generator([]))), 0)
def test_number(self): self.assertEqual(len(list(random_stories_generator(self.story, number=10))), 10)
def test_length(self): self.assertEqual(len(next(random_stories_generator(self.story))), 5) self.assertEqual(len(next(random_stories_generator(self.story, length=3))), 3) self.assertEqual(len(next(random_stories_generator(self.story, length=6))), 6) self.assertEqual(len(next(random_stories_generator([]))), 0)
def test_number(self): self.assertEqual( len(list(random_stories_generator(self.story, number=10))), 10)