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
49 lines
2.5 KiB
Gherkin
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"
|