예제 #1
0
    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)
예제 #2
0
파일: test_s3.py 프로젝트: Yelp/mrjob
    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)
예제 #3
0
    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)
예제 #4
0
파일: test_s3.py 프로젝트: Yelp/mrjob
    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)