Skip to main content
View module source on GitHub Test case to simulate RemoteDisconnected connection errors and verify retry logic. This test demonstrates how the improved connection pool and retry logic in maxim_apis.py handles connection issues that users were experiencing.

TestConnectionRetryLogic

Test cases for connection retry logic improvements.

setUp

Set up test fixtures.

test_connection_pool_configuration

Test that connection pool is configured with improved settings.

test_remote_disconnected_retry_success

Test that RemoteDisconnected errors are retried and eventually succeed.

test_pool_error_retry_logic

Test that PoolError has separate retry logic with different parameters.

test_http_error_no_retry

Test that HTTP errors are not retried (permanent failures).

test_max_retries_exhausted

Test behavior when max retries are exhausted.

test_exponential_backoff_timing

Test that exponential backoff timing is correct.

test_file_upload_remote_disconnected_retry

Test that file upload handles RemoteDisconnected errors with retry logic.

test_file_upload_http_error_no_retry

Test that file upload HTTP errors are not retried.

test_api_method_with_connection_error

Test that actual API methods handle connection errors properly.

test_different_connection_errors_are_caught

Test that various connection-related errors are properly caught in our exception handling.

test_unexpected_exception_handling

Test that unexpected exceptions are properly logged and re-raised.

test_request_exception_retry_logic

Test that general RequestException errors are retried.

test_custom_retry_parameters

Test retry logic with custom parameters.

test_connection_pool_session_context_manager

Test that the connection pool context manager works correctly.

test_version_check_during_retry

Test that version checking works correctly during retry scenarios.

TestFileUploadRetryLogic

Separate test class for file upload specific retry logic.

setUp

Set up test fixtures.

test_file_upload_extended_timeout

Test that file uploads use extended timeouts.

test_file_upload_retry_exhaustion

Test file upload behavior when all retries are exhausted.