Ejemplo n.º 1
0
 def test_retry_iterator_one(self):
     it = apilint._retry_iterator([1])
     self.assertEqual(it.next(), 1)
     it.send("retry")
     self.assertEqual(it.next(), 1)
     with self.assertRaises(StopIteration):
         it.next()
Ejemplo n.º 2
0
 def test_retry_iterator(self):
     it = apilint._retry_iterator([1, 2, 3, 4])
     self.assertEqual(it.next(), 1)
     self.assertEqual(it.next(), 2)
     self.assertEqual(it.next(), 3)
     it.send("retry")
     self.assertEqual(it.next(), 3)
     self.assertEqual(it.next(), 4)
     with self.assertRaises(StopIteration):
         it.next()