def test_min_backoff(self): self.wrapped_client = _wrap_aws_client(self.client, min_backoff=1000) self.add_transient_error(socket.error(110, 'Connection timed out')) self.assertEqual(self.wrapped_client.list_buckets(), dict(Buckets=[])) self.sleep.assert_called_with(1000) self.assertTrue(self.log.info.called)
def setUp(self): super(WrapAWSClientTestCase, self).setUp() # don't actually wait between retries self.sleep = self.start(patch('time.sleep')) self.log = self.start(patch('mrjob.retry.log')) self.list_buckets = self.start( patch('tests.mock_boto3.s3.MockS3Client.list_buckets', side_effect=[dict(Buckets=[])])) self.client = self.client('s3') self.wrapped_client = _wrap_aws_client(self.client)
def setUp(self): super(WrapAWSClientTestCase, self).setUp() # don't actually wait between retries self.sleep = self.start(patch('time.sleep')) self.log = self.start(patch('mrjob.retry.log')) self.list_buckets = self.start(patch( 'tests.mock_boto3.s3.MockS3Client.list_buckets', side_effect=[dict(Buckets=[])])) self.client = self.client('s3') self.wrapped_client = _wrap_aws_client(self.client)