Пример #1
0
def test_custom_retry_failure(error_code):
    def callback():
        raise ClientError({'Error': {'Code': 'test-error'}}, 'test-op')

    with pytest.raises(ClientError) as exc_info:
        batch_versioning.custom_retry(callback, error_code, 3)
    assert exc_info.value.response['Error']['Code'] == 'test-error'
Пример #2
0
def test_custom_retry():
    def callback():
        return 'Success!'

    response = batch_versioning.custom_retry(callback, 'test-error', 3)
    assert response == 'Success!'