forked from cleveragents/cleveragents-core
9d4d27d7e8
Fix 25 E501 line-too-long violations in RST/markdown docstring tables across resource.py, tool.py, models.py, and lifecycle.py. Also fix invalid test expectation in project_commands_coverage.feature where project list with no database was expected to abort but now succeeds with an empty list after the redesign.
150 lines
5.9 KiB
Gherkin
150 lines
5.9 KiB
Gherkin
Feature: Project Commands Coverage
|
|
As a developer
|
|
I want to test all project command functionality
|
|
So that project.py achieves high code coverage
|
|
|
|
@phase1
|
|
Scenario: Test project init with default parameters
|
|
Given I have a temporary working directory
|
|
When I run project init without any parameters
|
|
Then the project should be initialized in current directory
|
|
And the success message should show project name and location
|
|
And the .cleveragents directory should be created
|
|
|
|
@phase1
|
|
Scenario: Test project init with custom name
|
|
Given I have a temporary working directory
|
|
When I run project init with name "test-project"
|
|
Then the project should be initialized with name "test-project"
|
|
And the success panel should display "test-project"
|
|
|
|
@phase1
|
|
Scenario: Test project init with custom path
|
|
Given I have a temporary working directory
|
|
And I create a subdirectory "myproject"
|
|
When I run project init with path "myproject"
|
|
Then the project should be initialized in "myproject" directory
|
|
And the .cleveragents directory should exist in "myproject"
|
|
|
|
@phase1
|
|
Scenario: Test project init force flag with existing project
|
|
Given I have a temporary working directory
|
|
And I have already initialized a project
|
|
When I execute project init with force option
|
|
Then the project should be reinitialized successfully
|
|
And no error should be raised
|
|
|
|
@phase1
|
|
Scenario: Test project init validation error handling
|
|
Given I have a temporary working directory
|
|
And the project service will raise a ValidationError with details
|
|
When I run project init and it fails with validation error
|
|
Then the error message should be displayed in red
|
|
And the validation error details should be shown
|
|
And the command should abort with ValidationError
|
|
|
|
@phase1
|
|
Scenario: Test project init configuration error handling
|
|
Given I have a temporary working directory
|
|
And the project service will raise a ConfigurationError
|
|
When I run project init and it fails with configuration error
|
|
Then the configuration error message should be displayed
|
|
And the command should abort with ConfigurationError
|
|
|
|
@phase1
|
|
Scenario: Test project init generic CleverAgentsError handling
|
|
Given I have a temporary working directory
|
|
And the project service will raise a CleverAgentsError
|
|
When I run project init and it fails with CleverAgentsError
|
|
Then the generic error message should be displayed
|
|
And the command should abort with CleverAgentsError
|
|
|
|
@phase1
|
|
Scenario: Test project init unexpected exception handling
|
|
Given I have a temporary working directory
|
|
And the project service will raise an unexpected exception
|
|
When I run project init and it fails unexpectedly
|
|
Then the unexpected error message should be displayed
|
|
And the command should abort with generic exception
|
|
|
|
@phase1
|
|
Scenario: Test project status with existing project
|
|
Given I have a temporary working directory
|
|
And I have an initialized project with stats
|
|
When I execute project status command
|
|
Then the project information should be displayed
|
|
And the statistics should include plans count
|
|
And the statistics should include context files count
|
|
And the statistics should include changes count
|
|
And the current plan should be shown
|
|
|
|
@phase1
|
|
Scenario: Test project status with no project
|
|
Given I have a temporary working directory
|
|
And there is no initialized project
|
|
When I execute project status command
|
|
Then an error should show "No project found in current directory"
|
|
And it should suggest running "cleveragents init"
|
|
And the command should exit with code 1
|
|
|
|
@phase1
|
|
Scenario: Test project status error handling
|
|
Given I have a temporary working directory
|
|
And the project service will raise a CleverAgentsError on status
|
|
When I execute project status and it fails
|
|
Then the error message should be shown
|
|
And the command should abort
|
|
|
|
@phase1
|
|
Scenario: Test project list command with no database
|
|
When I run project list command
|
|
Then the project command should succeed
|
|
|
|
@phase1
|
|
Scenario: Test project clean command not implemented
|
|
When I run project clean command
|
|
Then it should display "Project cleaning not yet implemented"
|
|
And the command should abort
|
|
|
|
@phase1
|
|
Scenario: Test project clean with confirmation flag
|
|
When I run project clean command with --yes flag
|
|
Then it should display "Project cleaning not yet implemented"
|
|
And the command should abort regardless of confirmation
|
|
|
|
@phase1
|
|
Scenario: Show file filters for current project
|
|
Given I have a temporary working directory
|
|
And I have a mocked project with file filters
|
|
When I run project file-filter show
|
|
Then it should display the current file filters
|
|
And the project command should succeed
|
|
|
|
@phase1
|
|
Scenario: Show file filters when no project exists
|
|
Given I have a temporary working directory
|
|
When I run project file-filter show with no project
|
|
Then it should warn about the missing project
|
|
And the project command should exit with code 1
|
|
|
|
@phase1
|
|
Scenario: Add include and default exclude globs
|
|
Given I have a temporary working directory
|
|
And I have a mocked project with file filters
|
|
When I add file filters include "src/*" exclude "tests/*" with defaults
|
|
Then it should update filters with defaults applied
|
|
|
|
@phase1
|
|
Scenario: Clear file filters when no flags provided
|
|
Given I have a temporary working directory
|
|
And I have a mocked project with file filters
|
|
When I clear project file filters without flags
|
|
Then it should clear both include and exclude filters
|
|
|
|
@phase1
|
|
Scenario: Remove specific include and exclude filters
|
|
Given I have a temporary working directory
|
|
And I have a mocked project with file filters
|
|
When I remove project file filters include "docs/*" exclude "build/*"
|
|
Then it should remove the specified file filters
|