Exemplo n.º 1
0
    def test_should_retry_upload_five_times(self):
        counter = [0]
        def upload_func(*args, **kwargs):
            counter[0] += 1
            raise Exception()

        s3upload.upload_part(upload_func, '_', '_', '_')
        self.assertEqual(counter[0], 5)
Exemplo n.º 2
0
    def test_should_return_error_when_upload_func_raises_error(self):
        def upload_func(*args, **kwargs):
            raise Exception()

        with self.assertRaises(threading.ThreadError):
            raise s3upload.upload_part(upload_func, '_', '_', '_')