def test_shuffle_repeat(self): self.pl.order = RepeatListForever(OrderShuffle()) numbers = [self.pl.current for _ in range(30) if self.pl.next_ended() or True] allnums = sorted(list(range(10)) * 3) self.assertNotEqual(numbers, allnums) numbers.sort() self.assertEqual(numbers, allnums)
def test_repeat_all_cycles_playlist(self): self.pl.go_to(3) self.pl.order = RepeatListForever(OrderInOrder()) self.failUnlessEqual(self.pl.current, 3) self.pl.next() self.failUnlessEqual(self.pl.current, 4) for i in range(9): self.pl.next_ended() self.failUnlessEqual(self.pl.current, 3)