Files
cleveragents-core/features/lsp_tool_adapter_coverage.feature
T
freemo 31472b5413 test(coverage): add Behave scenarios for 39 under-covered modules
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate.

ISSUES CLOSED: #1232
2026-03-31 21:47:12 +00:00

49 lines
2.5 KiB
Gherkin

Feature: LSP Tool Adapter uncovered-line coverage
Exercise runtime-handler branches, workspace-symbols paths,
missing-argument guards, and the None-config check in
LspToolAdapter.generate_tool_specs (tool_adapter.py lines
126-153 and 198).
Scenario: ltacov generate_tool_specs raises ValueError when config is None
Given ltacov an LspToolAdapter with no runtime
When ltacov generate_tool_specs is called with None config
Then ltacov a ValueError with message "config must not be None" is raised
Scenario: ltacov workspace-symbols handler returns error when query is empty
Given ltacov a mock LspRuntime
And ltacov a runtime handler for workspace_symbols capability
When ltacov the handler is called with no query argument
Then ltacov the result is an error dict saying "query is required"
Scenario: ltacov workspace-symbols handler raises LspNotAvailableError with valid query
Given ltacov a mock LspRuntime
And ltacov a runtime handler for workspace_symbols capability
When ltacov the handler is called with query "MyClass"
Then ltacov an LspNotAvailableError is raised mentioning "workspace_symbols"
Scenario: ltacov runtime handler returns error when file_path is missing
Given ltacov a mock LspRuntime
And ltacov a runtime handler for diagnostics capability
When ltacov the handler is called with no file_path argument
Then ltacov the result is an error dict saying "file_path is required"
Scenario: ltacov runtime handler delegates diagnostics to runtime
Given ltacov a mock LspRuntime
And ltacov the runtime get_diagnostics returns sample items
And ltacov a runtime handler for diagnostics capability
When ltacov the handler is called with file_path "src/main.py"
Then ltacov the result contains a "diagnostics" key with the sample items
Scenario: ltacov runtime handler delegates completions to runtime
Given ltacov a mock LspRuntime
And ltacov the runtime get_completions returns sample items
And ltacov a runtime handler for completions capability
When ltacov the handler is called with file_path "src/main.py" line 10 column 5
Then ltacov the result contains a "completions" key with the sample items
Scenario: ltacov runtime handler raises LspNotAvailableError for unimplemented capability
Given ltacov a mock LspRuntime
And ltacov a runtime handler for hover capability
When ltacov the handler is called with file_path "src/main.py"
Then ltacov an LspNotAvailableError is raised mentioning "hover"