forked from cleveragents/cleveragents-core
31472b5413
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate. ISSUES CLOSED: #1232
72 lines
3.5 KiB
Gherkin
72 lines
3.5 KiB
Gherkin
Feature: Application Container coverage round 3
|
|
Exercise remaining uncovered lines in container.py:
|
|
- _build_stream_router (lines 117, 119)
|
|
- _build_langgraph_bridge (lines 124, 126)
|
|
- _build_route_bridge (lines 131, 133)
|
|
- _lazy_register_registry_agents (lines 138, 142)
|
|
- _build_skill_service ImportError fallback (lines 386-391, 393)
|
|
- get_container audit_event_subscriber exception path (lines 851-857)
|
|
|
|
Background:
|
|
Given acncov3 a clean container state
|
|
|
|
# -----------------------------------------------------------------
|
|
# _build_stream_router (lines 117, 119)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: Build stream router lazily imports and returns instance
|
|
When acncov3 I call _build_stream_router
|
|
Then acncov3 the result should be a ReactiveStreamRouter instance
|
|
|
|
# -----------------------------------------------------------------
|
|
# _build_langgraph_bridge (lines 124, 126)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: Build langgraph bridge lazily imports and returns instance
|
|
Given acncov3 a mock stream router
|
|
When acncov3 I call _build_langgraph_bridge with the mock stream router
|
|
Then acncov3 the result should be a RxPyLangGraphBridge instance
|
|
And acncov3 the bridge should reference the mock stream router
|
|
|
|
# -----------------------------------------------------------------
|
|
# _build_route_bridge (lines 131, 133)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: Build route bridge lazily imports and returns instance
|
|
Given acncov3 a mock stream router
|
|
And acncov3 a mock agents registry
|
|
When acncov3 I call _build_route_bridge with the mock stream router and agents
|
|
Then acncov3 the result should be a RouteBridge instance
|
|
And acncov3 the route bridge should reference the mock stream router
|
|
|
|
# -----------------------------------------------------------------
|
|
# _lazy_register_registry_agents (lines 138, 142)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: Lazy register registry agents calls the adapter function
|
|
Given acncov3 a mock stream router for registration
|
|
And acncov3 a mock route bridge for registration
|
|
And acncov3 a mock actor registry for registration
|
|
When acncov3 I call _lazy_register_registry_agents
|
|
Then acncov3 register_registry_agents should have been invoked
|
|
|
|
# -----------------------------------------------------------------
|
|
# _build_skill_service ImportError (lines 386-391, 393)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: Build skill service falls back to in-memory when SQLAlchemy import fails
|
|
When acncov3 I call _build_skill_service with SQLAlchemy import blocked
|
|
Then acncov3 the result should be an in-memory SkillService
|
|
And acncov3 the in-memory SkillService should have no repository
|
|
|
|
# -----------------------------------------------------------------
|
|
# get_container audit_event_subscriber exception (lines 851-857)
|
|
# -----------------------------------------------------------------
|
|
|
|
Scenario: get_container handles audit_event_subscriber exception gracefully
|
|
Given acncov3 the container is reset
|
|
And acncov3 audit_event_subscriber is patched to raise an error
|
|
When acncov3 I call get_container
|
|
Then acncov3 a valid container should be returned despite the error
|
|
And acncov3 the container should be cached as the global singleton
|