Пример #1
0
 def test_ncycles(self):
     it = iters.ncycles([10, 11], 2)
     self.assertEqual(10, next(it))
     self.assertEqual(11, next(it))
     self.assertEqual(10, next(it))
     self.assertEqual(11, next(it))
     self.assertRaises(StopIteration, next, it)
Пример #2
0
 def test_ncycles(self):
     it = iters.ncycles([10,11], 2)
     self.assertEqual(10, next(it))
     self.assertEqual(11, next(it))
     self.assertEqual(10, next(it))
     self.assertEqual(11, next(it))
     self.assertRaises(StopIteration, next, it)