62 lines
3.0 KiB
Gherkin
62 lines
3.0 KiB
Gherkin
Feature: Project CLI coverage round 2 – remaining uncovered lines
|
||
As a developer
|
||
I want to exercise the remaining uncovered code paths in project.py
|
||
So that lines 73-76, 81-84, 89-92, 152, 164, 167, and 843 are covered
|
||
|
||
Background:
|
||
Given the r2 project CLI mocks are prepared
|
||
|
||
# ── _get_namespaced_project_repo helper (lines 73, 75, 76) ──
|
||
|
||
Scenario: _get_namespaced_project_repo returns repo from the DI container
|
||
When I call the actual _get_namespaced_project_repo helper with a mocked container
|
||
Then the r2 helper result should be the mock namespaced project repo
|
||
|
||
# ── _get_resource_link_repo helper (lines 81, 83, 84) ──
|
||
|
||
Scenario: _get_resource_link_repo returns link repo from the DI container
|
||
When I call the actual _get_resource_link_repo helper with a mocked container
|
||
Then the r2 helper result should be the mock resource link repo
|
||
|
||
# ── _get_resource_registry_service helper (lines 89, 91, 92) ──
|
||
|
||
Scenario: _get_resource_registry_service returns registry from the DI container
|
||
When I call the actual _get_resource_registry_service helper with a mocked container
|
||
Then the r2 helper result should be the mock resource registry service
|
||
|
||
# ── _project_spec_dict fallback for linked_at without isoformat (line 152) ──
|
||
|
||
Scenario: _project_spec_dict uses str fallback when linked_at has no isoformat
|
||
Given a mock project with a linked resource whose linked_at is a plain string
|
||
When I call _project_spec_dict on that project
|
||
Then the linked resource linked_at should be the plain string value
|
||
|
||
# ── _project_spec_dict fallback for created_at without isoformat (line 164) ──
|
||
|
||
Scenario: _project_spec_dict uses str fallback when created_at has no isoformat
|
||
Given a mock project whose created_at is a plain string
|
||
When I call _project_spec_dict on that project
|
||
Then the result created_at should be the plain string value
|
||
|
||
# ── _project_spec_dict fallback for updated_at without isoformat (line 167) ──
|
||
|
||
Scenario: _project_spec_dict uses str fallback when updated_at has no isoformat
|
||
Given a mock project whose updated_at is a plain string
|
||
When I call _project_spec_dict on that project
|
||
Then the result updated_at should be the plain string value
|
||
|
||
# ── Combined: all three date fallbacks in one project with linked resources ──
|
||
|
||
Scenario: _project_spec_dict handles all string dates together with linked resources
|
||
Given a mock project where all dates and linked_at are plain strings
|
||
When I call _project_spec_dict on that project
|
||
Then all date fields in the result should be plain string values
|
||
|
||
# ── list_projects rich table fallback for created_at without strftime (line 843) ──
|
||
|
||
Scenario: list command renders table when project created_at is a plain string
|
||
Given the r2 project repo returns projects with string created_at values
|
||
When I invoke the r2 CLI list command with rich format
|
||
Then the r2 CLI output should contain the truncated string date
|
||
And the r2 CLI exit code should be 0
|