cdp.auth.test package¶
Subpackages¶
- cdp.auth.test.factories package
- Submodules
- cdp.auth.test.factories.auth_client_options_factory module
- cdp.auth.test.factories.auth_headers_factory module
- cdp.auth.test.factories.auth_options_factory module
- cdp.auth.test.factories.http_client_factory module
- cdp.auth.test.factories.http_response_factory module
- cdp.auth.test.factories.jwt_options_factory module
- cdp.auth.test.factories.private_key_factory module
- Module contents
Submodules¶
cdp.auth.test.test_client module¶
- cdp.auth.test.test_client.test_request_adds_auth_headers(mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory)¶
Test that requests include authentication headers.
- cdp.auth.test.test_client.test_request_merges_headers(mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory)¶
Test that custom headers are merged with auth headers.
- cdp.auth.test.test_client.test_request_url_handling(mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory)¶
Test handling of relative and absolute URLs.
- cdp.auth.test.test_client.test_request_with_debug(mock_logger, mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory, http_client_factory, http_response_factory, auth_headers_factory)¶
Test client with debug logging enabled.
- cdp.auth.test.test_client.test_request_with_json_body(mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory)¶
Test request with JSON body.
- cdp.auth.test.test_client.test_request_with_query_params(mock_get_headers, mock_pool_manager, mock_jwt, auth_client_options_factory)¶
Test handling of query parameters in the URL.
cdp.auth.test.test_http module¶
- cdp.auth.test.test_http.test_get_auth_headers(mock_jwt, auth_options_factory)¶
Test getting authentication headers.
- cdp.auth.test.test_http.test_get_auth_headers_missing_wallet_auth(mock_jwt, auth_options_factory)¶
Test error when wallet auth is required but not provided.
- cdp.auth.test.test_http.test_get_auth_headers_with_wallet_auth(mock_wallet_jwt, mock_jwt, auth_options_factory)¶
Test creating headers with wallet authentication.
- cdp.auth.test.test_http.test_get_correlation_data(source, version, expected_source)¶
Test correlation data generation.
- cdp.auth.test.test_http.test_requires_wallet_auth(request_method, request_path, expected)¶
Test wallet auth requirement detection.
cdp.auth.test.test_jwt module¶
- cdp.auth.test.test_jwt.ec_private_key()¶
Fixture that generates an EC private key in PEM format for testing.
- Returns:
PEM-encoded EC private key
- Return type:
str
- cdp.auth.test.test_jwt.ed25519_private_key()¶
Fixture that generates an Ed25519 private key in base64 format for testing.
- Returns:
Base64-encoded Ed25519 private key
- Return type:
str
- cdp.auth.test.test_jwt.jwt_options()¶
Fixture that provides basic JWT options for testing.
- Returns:
Basic JWT options for testing
- Return type:
- cdp.auth.test.test_jwt.test_generate_jwt_custom_expiry(ec_private_key_factory, jwt_options_factory)¶
Test JWT generation with custom expiry time.
- cdp.auth.test.test_jwt.test_generate_jwt_default_expiry(ec_private_key_factory, jwt_options_factory)¶
Test JWT generation with default expiry time.
- cdp.auth.test.test_jwt.test_generate_jwt_ec(ec_private_key_factory, jwt_options_factory)¶
Test JWT generation with EC key.
- cdp.auth.test.test_jwt.test_generate_jwt_ed25519(ed25519_private_key_factory, jwt_options_factory)¶
Test JWT generation with Ed25519 key.
- cdp.auth.test.test_jwt.test_generate_jwt_missing_params(jwt_options_factory, field, value, error_message)¶
Test JWT generation with missing parameters.
- cdp.auth.test.test_jwt.test_generate_nonce()¶
Test nonce generation.
- cdp.auth.test.test_jwt.test_parse_private_key_ec(ec_private_key_factory)¶
Test parsing an EC private key.
- cdp.auth.test.test_jwt.test_parse_private_key_ed25519(ed25519_private_key_factory)¶
Test parsing an Ed25519 private key.
- cdp.auth.test.test_jwt.test_parse_private_key_invalid()¶
Test parsing an invalid private key.