

def test_retry_default(self):
    ' If no value is specified, should retry connects 3 times '
    retry = Retry()
    self.assertEqual(retry.total, 10)
    self.assertEqual(retry.connect, None)
    self.assertEqual(retry.read, None)
    self.assertEqual(retry.redirect, None)
    error = ConnectTimeoutError()
    retry = Retry(connect=1)
    retry = retry.increment(error=error)
    self.assertRaises(MaxRetryError, retry.increment, error=error)
    retry = Retry(connect=1)
    retry = retry.increment(error=error)
    self.assertFalse(retry.is_exhausted())
    self.assertTrue(Retry(0).raise_on_redirect)
    self.assertFalse(Retry(False).raise_on_redirect)

dataset/ETHPy150Open shazow/urllib3/test/test_retry.py RetryTest.test_retry_default/original