Files
cleveragents-core/tests/features/config_specific_coverage.feature

108 lines
5.4 KiB
Gherkin

Feature: Configuration Specific Line Coverage
As a developer
I want to test specific uncovered lines in config.py
So that we achieve 90%+ code coverage
Background:
Given the configuration testing environment is set up
Scenario: Test file loading with None YAML content - line 69
Given I have a YAML file that loads as None
When I load the configuration files through ConfigurationManager
Then the None content should be skipped and processing continues
Scenario: Test file loading with non-dict YAML content - line 72
Given I have a YAML file with list content instead of dict
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about YAML dictionary requirement
Scenario: Test YAML parsing error - lines 77-85
Given I have a YAML file with malformed syntax
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about YAML parsing failure
Scenario: Test file not found error - lines 82-85
Given I have a configuration file path that does not exist
When I load the configuration files through ConfigurationManager
Then a ConfigurationError should be raised about file loading failure
Scenario: Test schema validation exception handling - lines 131-134
Given I have a configuration manager with schema validator that raises Exception
When I call validate method
Then a ConfigurationError should be raised about validation failure
Scenario: Test set method with empty path - line 175-176
Given I have a ConfigurationManager instance
When I call set method with empty path
Then a ConfigurationError should be raised about empty path
Scenario: Test set method with non-dict parent path - lines 182-183
Given I have a ConfigurationManager with string value in config
When I call set method to create nested path under string value
Then a ConfigurationError should be raised about parent not being dictionary
Scenario: Test set method with non-dict final parent - lines 187, 190-191
Given I have a ConfigurationManager with nested config
When I call set method where final parent is not dict
Then a ConfigurationError should be raised about final parent not being dictionary
Scenario: Test environment variable interpolation missing var - line 238-240
Given I have configuration with undefined environment variable
When I call interpolate_env_vars method
Then a ConfigurationError should be raised about variable not set
Scenario: Test interpolate_env_vars default value handling - lines 229-236
Given I have configuration with environment variables with different default types
When I call interpolate_env_vars method
Then boolean defaults should be processed as strings
And numeric defaults should be returned as strings
And string defaults should be returned unchanged
Scenario: Test environment variable interpolation with actual string replacement
Given the configuration testing environment is set up
Given I have configuration with environment variables that need string processing
When I call interpolate_env_vars method
Then environment variable replacement should work correctly
Scenario: Test ConfigurationError is re-raised during file loading - lines 82-83
Given the configuration testing environment is set up
Given I have a configuration manager that throws ConfigurationError during loading
When I attempt to load configuration files
Then the original ConfigurationError should be re-raised
Scenario: Test Exception converted to ConfigurationError during file loading - lines 84-87
Given the configuration testing environment is set up
Given I have a configuration manager that throws generic Exception during loading
When I attempt to load configuration files
Then a ConfigurationError should be raised about file loading failure
Scenario: Test string type conversion boolean - line 247
Given I have string configuration values that are boolean
When I call interpolate_env_vars method
Then boolean strings should be converted to boolean values
Scenario: Test string type conversion integer - line 249
Given I have string configuration values that are integers
When I call interpolate_env_vars method
Then integer strings should be converted to integer values
Scenario: Test string type conversion float - line 251
Given I have string configuration values that are floats
When I call interpolate_env_vars method
Then float strings should be converted to float values
Scenario: Test schema validation non-dict agent config - line 312
Given I have configuration with agent config as non-dict value
When I call schema validator validate method
Then a ConfigurationError should be raised about agent config dictionary
Scenario: Test schema validation non-dict agent entry - line 325
Given I have configuration with agent entry as non-dict value
When I call schema validator validate method
Then a ConfigurationError should be raised about agent configuration dictionary
Scenario: Test additional coverage scenarios for 90%+ coverage
Given the configuration testing environment is set up
Given I have comprehensive test scenarios for remaining lines
When I execute all remaining coverage tests
Then config coverage should reach 90% or higher