Skip to content

Commit 48ed5f9

Browse files
committed
chore: remove uneeded module blocks
1 parent fd3e299 commit 48ed5f9

File tree

3 files changed

+0
-204
lines changed

3 files changed

+0
-204
lines changed

test/unit/oauth/test_oauth_base_config_u.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,3 @@
1-
"""
2-
Unit tests for OAuthConfig base class.
3-
4-
The OAuthConfig class provides the abstract base class for OAuth configuration management
5-
across different OAuth protocol versions. This base class defines common attributes
6-
and methods for handling OAuth authentication lifecycle, including initialization,
7-
maintenance, and shutdown behaviors.
8-
9-
Core Functionality Tested:
10-
==========================
11-
12-
1. **Abstract Method Implementation**:
13-
- Version method abstract enforcement
14-
- Proper NotImplementedError raising for abstract methods
15-
16-
2. **Configuration Management**:
17-
- Default parameter initialization from environment variables
18-
- Configuration copying with modifications
19-
- Attribute validation during copy operations
20-
21-
3. **Lifecycle Control**:
22-
- OAuth initialization behavior configuration
23-
- Brokerage session management settings
24-
- OAuth maintenance and shutdown control
25-
26-
Key Components:
27-
===============
28-
29-
- **OAuthConfig**: Abstract base class for OAuth configuration
30-
- **Configuration Copying**: Deep configuration modification capabilities
31-
- **Environment Integration**: Default values from environment variables
32-
- **Abstract Method Pattern**: Enforced implementation in subclasses
33-
34-
Test Coverage:
35-
==============
36-
37-
This test suite focuses on the base class functionality that provides the foundation
38-
for OAuth protocol implementations:
39-
40-
- **Abstract Method Validation**: Ensures subclass implementation requirements
41-
- **Configuration Copying**: Validates safe configuration modification patterns
42-
- **Attribute Management**: Tests proper attribute validation and assignment
43-
- **Default Behavior**: Verifies correct environment variable integration
44-
45-
The tests ensure that the base class provides a solid foundation for OAuth protocol
46-
implementations while maintaining proper abstraction boundaries and validation.
47-
48-
Security Considerations:
49-
========================
50-
51-
The base class handles OAuth configuration parameters that form the foundation
52-
for secure authentication flows. Tests ensure proper validation without exposing
53-
sensitive configuration details or creating security vulnerabilities through
54-
improper configuration handling.
55-
"""
56-
571
import pytest
582

593
from ibind.oauth import OAuthConfig

test/unit/oauth/test_oauth_config_u.py

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,3 @@
1-
"""
2-
Unit tests for OAuth1aConfig.
3-
4-
The OAuth1aConfig class provides configuration management for OAuth 1.0a authentication
5-
with Interactive Brokers (IBKR) API. This configuration class handles the validation
6-
and storage of all required parameters for establishing secure OAuth 1.0a connections
7-
including API endpoints, tokens, keys, and cryptographic key file paths.
8-
9-
Core Functionality Tested:
10-
==========================
11-
12-
1. **Configuration Initialization**:
13-
- Default parameter initialization
14-
- Custom parameter assignment
15-
- Version identification for OAuth protocol
16-
17-
2. **Configuration Validation**:
18-
- Required parameter presence validation
19-
- File path existence verification
20-
- Comprehensive error reporting for missing components
21-
22-
3. **Parameter Management**:
23-
- OAuth endpoint URL configuration
24-
- Access token and secret handling
25-
- Consumer key and DH prime parameter storage
26-
- Encryption and signature key file path management
27-
28-
Key Components:
29-
===============
30-
31-
- **OAuth1aConfig**: Main configuration class for OAuth 1.0a parameters
32-
- **Parameter Validation**: Required field checking and file existence verification
33-
- **Error Handling**: Descriptive error messages for configuration issues
34-
35-
Required Parameters:
36-
===================
37-
38-
The OAuth1aConfig requires the following parameters for proper operation:
39-
- oauth_rest_url: Base URL for OAuth REST API endpoints
40-
- live_session_token_endpoint: Endpoint path for live session token requests
41-
- access_token: OAuth access token for authenticated requests
42-
- access_token_secret: Secret associated with the access token
43-
- consumer_key: OAuth consumer key identifying the application
44-
- dh_prime: Diffie-Hellman prime parameter for key exchange
45-
- encryption_key_fp: File path to encryption private key
46-
- signature_key_fp: File path to signature private key
47-
48-
Test Coverage:
49-
==============
50-
51-
This test suite focuses on configuration validation logic that ensures:
52-
53-
- **Parameter Completeness**: All required OAuth parameters are provided
54-
- **File System Validation**: Cryptographic key files exist and are accessible
55-
- **Error Reporting**: Clear, actionable error messages for configuration issues
56-
- **Version Compliance**: Correct OAuth protocol version identification
57-
58-
The tests use temporary files to simulate real key file scenarios while avoiding
59-
dependencies on actual cryptographic key content or permanent file system state.
60-
61-
Security Considerations:
62-
========================
63-
64-
This configuration class handles sensitive authentication parameters including:
65-
- Access tokens and secrets
66-
- Consumer keys
67-
- File paths to private cryptographic keys
68-
69-
Tests ensure proper validation without exposing sensitive values in error messages
70-
or test outputs, maintaining security best practices for credential handling.
71-
"""
72-
731
import tempfile
742
import pytest
753
from pathlib import Path

test/unit/support/test_logs_u.py

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,3 @@
1-
"""
2-
Unit tests for logging utilities.
3-
4-
The logs module provides centralized logging configuration and management for the ibind
5-
library. It handles console logging, file-based logging with daily rotation, and
6-
project-specific logger creation. The module supports environment-based configuration
7-
and ensures proper log formatting across all components.
8-
9-
Core Functionality Tested:
10-
==========================
11-
12-
1. **Project Logger Creation**:
13-
- Logger naming based on file paths
14-
- Default logger instantiation
15-
- Logger hierarchy and namespace management
16-
17-
2. **Logging System Initialization**:
18-
- Console output configuration
19-
- File-based logging setup
20-
- Log level and format configuration
21-
- Initialization state management and idempotency
22-
23-
3. **Daily Rotating File Handler**:
24-
- Automatic daily file rotation based on timestamps
25-
- File path generation with date suffixes
26-
- Directory creation for log files
27-
- Stream management and file handle lifecycle
28-
29-
4. **Configuration Management**:
30-
- Environment variable integration
31-
- Default value handling
32-
- Runtime configuration override
33-
- Logging behavior control flags
34-
35-
Key Components:
36-
===============
37-
38-
- **project_logger()**: Creates project-specific logger instances with proper naming
39-
- **ibind_logs_initialize()**: Configures the entire logging system with handlers and formatters
40-
- **new_daily_rotating_file_handler()**: Sets up file-based logging with daily rotation
41-
- **DailyRotatingFileHandler**: Custom logging handler for automatic daily file rotation
42-
43-
Test Coverage:
44-
==============
45-
46-
This test suite provides comprehensive coverage of logging functionality including:
47-
48-
- **Logger Creation**: All project logger naming patterns and configurations
49-
- **Initialization Logic**: Complete system setup with various parameter combinations
50-
- **File Handling**: Daily rotation mechanics, file creation, and cleanup
51-
- **Error Conditions**: Invalid configurations, file system errors, and edge cases
52-
- **State Management**: Initialization tracking, global state handling, and reset scenarios
53-
54-
The tests use extensive mocking to isolate logging components while maintaining
55-
realistic interaction patterns with the Python logging framework.
56-
57-
Logging Behavior:
58-
=================
59-
60-
The logging system supports multiple output modes:
61-
- Console-only logging for development
62-
- File-only logging for production
63-
- Combined console and file logging
64-
- Disabled logging for testing environments
65-
66-
File logs use daily rotation with timestamps in filenames (e.g., `app__2024-01-15.txt`)
67-
and automatic directory creation for log storage locations.
68-
69-
Security Considerations:
70-
========================
71-
72-
Logging systems handle potentially sensitive information and file system access.
73-
Tests ensure proper handling of file permissions, directory traversal prevention,
74-
and safe handling of user-provided log file paths without exposing system internals.
75-
"""
76-
771
import datetime
782
import logging
793
import pytest

0 commit comments

Comments
 (0)