forked from cleveragents/cleveragents-core
a808c395f9
Add 53 new .feature files and corresponding step definition files targeting uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts in 7 pre-existing step files by disambiguating step text. New tests cover: ACP clients/facade, actor CLI/config, application container, ACMS service/strategies, async worker, automation profile CLI, autonomy guardrail, bridge, change model, config CLI/service, context service, cross-plan correction, database models, decision service, decomposition clustering/service, discovery handler, langchain chat provider, langgraph nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/ preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI, provider registry, reactive application/route, repositories, resolver handler, resource registry service, resume model, retry patterns, sandbox protocol, server CLI, skill CLI/service, skills registry, subplan execution/service, system CLI, UKO loader, UoW, and YAML template engine. Closes #645
46 lines
2.2 KiB
Gherkin
46 lines
2.2 KiB
Gherkin
@resource_handlers @resolver_coverage
|
|
Feature: Handler resolver edge-case coverage
|
|
As a developer maintaining the handler resolution subsystem
|
|
I want to exercise the uncovered error paths in resolve_handler
|
|
So that every branch in resolver.py is tested
|
|
|
|
Background:
|
|
Given the handler cache is cleared
|
|
|
|
# --- Lines 72-73: empty module_path or class_name after split ---
|
|
|
|
Scenario: Reject handler reference with empty module path
|
|
When I try to resolve handler ref ":SomeClass"
|
|
Then a handler resolution error should be raised with message "both module path and class name are required"
|
|
|
|
Scenario: Reject handler reference with empty class name
|
|
When I try to resolve handler ref "some.module:"
|
|
Then a handler resolution error should be raised with message "both module path and class name are required"
|
|
|
|
# --- Lines 84-87: generic Exception (not ModuleNotFoundError) during import ---
|
|
|
|
Scenario: Generic exception during module import raises HandlerResolutionError
|
|
Given a module import that raises a generic RuntimeError
|
|
When I try to resolve the rigged handler reference
|
|
Then a handler resolution error should be raised with message "Error importing handler module"
|
|
|
|
# --- Lines 99-102: Exception during handler class instantiation ---
|
|
|
|
Scenario: Exception during handler instantiation raises HandlerResolutionError
|
|
Given a module whose handler class raises TypeError on init
|
|
When I try to resolve the rigged handler reference
|
|
Then a handler resolution error should be raised with message "Cannot instantiate handler"
|
|
|
|
# --- Lines 106-107: instantiated object does not satisfy ResourceHandler protocol ---
|
|
|
|
Scenario: Handler class not satisfying ResourceHandler protocol is rejected
|
|
Given a module whose handler class does not satisfy ResourceHandler
|
|
When I try to resolve the rigged handler reference
|
|
Then a handler resolution error should be raised with message "does not satisfy ResourceHandler protocol"
|
|
|
|
# --- Whitespace-only reference triggers line 53-54 ---
|
|
|
|
Scenario: Whitespace-only handler reference is treated as empty
|
|
When I try to resolve handler ref " "
|
|
Then a handler resolution error should be raised with message "must not be empty"
|