pub struct TestConfigService { /* private fields */ }
Expand description
Test configuration service implementation.
This service provides a fixed configuration for testing purposes, ensuring complete isolation between tests and predictable behavior. It does not load from external sources or cache.
Implementations§
Source§impl TestConfigService
impl TestConfigService
Sourcepub fn set_ai_settings_and_key(
&self,
provider: &str,
model: &str,
api_key: &str,
)
pub fn set_ai_settings_and_key( &self, provider: &str, model: &str, api_key: &str, )
Set AI provider, model, and API key for testing.
Sourcepub fn set_ai_settings_with_base_url(
&self,
provider: &str,
model: &str,
api_key: &str,
base_url: &str,
)
pub fn set_ai_settings_with_base_url( &self, provider: &str, model: &str, api_key: &str, base_url: &str, )
Set AI provider, model, API key, and custom base URL for testing.
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Create a new test configuration service with the provided configuration.
§Arguments
config
- The fixed configuration to use
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a test configuration service with default settings.
This is useful for tests that don’t need specific configuration values.
Sourcepub fn with_ai_settings(provider: &str, model: &str) -> Self
pub fn with_ai_settings(provider: &str, model: &str) -> Self
Create a test configuration service with specific AI settings.
§Arguments
provider
- AI provider namemodel
- AI model name
Sourcepub fn with_ai_settings_and_key(
provider: &str,
model: &str,
api_key: &str,
) -> Self
pub fn with_ai_settings_and_key( provider: &str, model: &str, api_key: &str, ) -> Self
Create a test configuration service with specific AI settings including API key.
§Arguments
provider
- AI provider namemodel
- AI model nameapi_key
- API key for the provider
Sourcepub fn with_sync_settings(correlation_threshold: f32, max_offset: f32) -> Self
pub fn with_sync_settings(correlation_threshold: f32, max_offset: f32) -> Self
Create a test configuration service with specific sync settings.
§Arguments
correlation_threshold
- Correlation threshold for synchronizationmax_offset
- Maximum time offset in seconds
Sourcepub fn with_parallel_settings(max_workers: usize, queue_size: usize) -> Self
pub fn with_parallel_settings(max_workers: usize, queue_size: usize) -> Self
Create a test configuration service with specific parallel processing settings.
§Arguments
max_workers
- Maximum number of parallel workersqueue_size
- Task queue size
Sourcepub fn config(&self) -> MutexGuard<'_, Config>
pub fn config(&self) -> MutexGuard<'_, Config>
Get the underlying configuration.
This is useful for tests that need direct access to the configuration object.
Sourcepub fn config_mut(&self) -> MutexGuard<'_, Config>
pub fn config_mut(&self) -> MutexGuard<'_, Config>
Get a mutable reference to the underlying configuration.
This allows tests to modify the configuration after creation.