Files
cleveragents-core/features/retry_patterns_coverage_boost.feature

54 lines
2.7 KiB
Gherkin

Feature: Retry Patterns Coverage Boost
Additional scenarios that exercise previously uncovered code paths
in the retry_patterns module.
Background:
Given the retry patterns coverage module is imported
Scenario: get_retry_decorator returns configured decorator for known category
When I request the retry decorator for known category "network"
Then the returned decorator should use the network category configuration
And calling the decorated function should succeed
Scenario: get_retry_decorator returns configured decorator for database category
When I request the retry decorator for known category "database"
Then the returned decorator should use the database category configuration
Scenario: RetryContext.execute accepts None as a valid return value
Given I have a retry context named "none-returning"
And I have a function that always returns None
When I execute the None-returning function with the retry context
Then None should be accepted as a valid return value
Scenario: RetryContext.async_execute accepts None as a valid return value
Given I have a retry context named "async-none-returning"
And I have an async function that always returns None
When I execute the async None-returning function with the retry context
Then None should be accepted as a valid async return value
Scenario: Auto-debug retry returns result dict without error key
Given I have an async function that returns a dict without an error key
When I apply auto-debug retry for dict success
Then the auto-debug result should be the success dict
Scenario: Auto-debug retry returns non-dict result
Given I have an async function that returns a non-dict result
When I apply auto-debug retry for non-dict success
Then the auto-debug result should be the non-dict value
Scenario: Auto-debug retry returns error dict when no debug callback is present
Given I have an async function that returns a dict with an error key
When I apply auto-debug retry without debug callback
Then the auto-debug result should be the error dict returned directly
Scenario: log_after_retry success path falls back when logger rejects keywords
Given a logger that rejects keyword arguments is installed for coverage boost
When I call log_after_retry with a successful outcome
Then the fallback success message should be logged
Scenario: log_after_retry failed path covers else-None branch in exception ternary
Given a logger that accepts all arguments is installed for coverage boost
And I have a retry state where outcome.failed toggles between checks
When I call log_after_retry with the toggling outcome
Then the exception keyword should resolve to None