b2c3c08415
CI / lint (push) Failing after 14s
CI / quality (push) Successful in 20s
CI / security (push) Successful in 40s
CI / typecheck (push) Successful in 44s
CI / coverage (push) Has been skipped
CI / build (push) Successful in 15s
CI / integration_tests (push) Successful in 4m6s
CI / unit_tests (push) Successful in 18m3s
CI / docker (push) Has been skipped
65 lines
3.1 KiB
Gherkin
65 lines
3.1 KiB
Gherkin
@unit @coverage @tool_registry
|
||
Feature: Tool Registry Service – uncovered error paths
|
||
As a developer maintaining the tool registry service
|
||
I want to exercise the error-handling branches that lack coverage
|
||
So that all delegation and error-propagation paths are tested
|
||
|
||
Background:
|
||
Given a mock-based tool registry service
|
||
|
||
# --- register_tool: DuplicateToolError propagation -------------------------
|
||
|
||
Scenario: register_tool propagates DuplicateToolError from repo.create
|
||
Given the mock tool repo create method raises DuplicateToolError
|
||
When I attempt to register the tool via the coverage service
|
||
Then a coverage DuplicateToolError should be raised
|
||
|
||
# --- register_tool: DatabaseError propagation ------------------------------
|
||
|
||
Scenario: register_tool propagates DatabaseError from repo.create
|
||
Given the mock tool repo create method raises DatabaseError
|
||
When I attempt to register the tool via the coverage service
|
||
Then a coverage DatabaseError should be raised with message containing "Failed to create"
|
||
|
||
# --- update_tool: ToolNotFoundError propagation ----------------------------
|
||
|
||
Scenario: update_tool propagates ToolNotFoundError from repo.update
|
||
Given the mock tool repo update method raises ToolNotFoundError
|
||
When I attempt to update a tool via the coverage service
|
||
Then a coverage ToolNotFoundError should be raised
|
||
|
||
# --- update_tool: DatabaseError propagation --------------------------------
|
||
|
||
Scenario: update_tool propagates DatabaseError from repo.update
|
||
Given the mock tool repo update method raises DatabaseError
|
||
When I attempt to update a tool via the coverage service
|
||
Then a coverage DatabaseError should be raised with message containing "Failed to update"
|
||
|
||
# --- remove_tool: returns False for missing tool ---------------------------
|
||
|
||
Scenario: remove_tool returns False when tool not found
|
||
Given the mock tool repo delete method returns False
|
||
When I attempt to remove tool "local/ghost" via the coverage service
|
||
Then the removal result should be False
|
||
|
||
# --- remove_tool: ToolInUseError propagation -------------------------------
|
||
|
||
Scenario: remove_tool propagates ToolInUseError from repo.delete
|
||
Given the mock tool repo delete method raises ToolInUseError
|
||
When I attempt to remove tool "local/in-use" via the coverage service
|
||
Then a coverage ToolInUseError should be raised
|
||
|
||
# --- attach_validation: validation not found -------------------------------
|
||
|
||
Scenario: attach_validation raises NotFoundError when validation does not exist
|
||
Given the mock tool repo returns None for get_by_name
|
||
When I attempt to attach validation with mode "required" via the coverage service
|
||
Then a coverage NotFoundError should be raised with message containing "not found"
|
||
|
||
# --- attach_validation: successful delegation ------------------------------
|
||
|
||
Scenario: attach_validation delegates to attachment repo when validation exists
|
||
Given the mock tool repo returns a sentinel for get_by_name
|
||
When I attempt to attach validation with mode "required" via the coverage service
|
||
Then no error should be raised by the coverage service
|