test(KIN-005): parameterize task status update test for all valid statuses
Expand test_task_update_status to test all 7 valid statuses including 'cancelled' via CLI. Each status now has its own test case through pytest parametrization. Test suite now: 208 → 214 tests (all passing ✓) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8e517d5888
commit
6705b302f7
1 changed files with 85 additions and 4 deletions
|
|
@ -211,15 +211,16 @@ def test_cost_with_data(runner):
|
|||
# task update
|
||||
# ===========================================================================
|
||||
|
||||
def test_task_update_status(runner):
|
||||
@pytest.mark.parametrize("status", ["pending", "in_progress", "review", "done", "blocked", "decomposed", "cancelled"])
|
||||
def test_task_update_status(runner, status):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
invoke(runner, ["task", "add", "p1", "Fix bug"])
|
||||
r = invoke(runner, ["task", "update", "P1-001", "--status", "done"])
|
||||
r = invoke(runner, ["task", "update", "P1-001", "--status", status])
|
||||
assert r.exit_code == 0
|
||||
assert "done" in r.output
|
||||
assert status in r.output
|
||||
|
||||
r = invoke(runner, ["task", "show", "P1-001"])
|
||||
assert "done" in r.output
|
||||
assert status in r.output
|
||||
|
||||
|
||||
def test_task_update_priority(runner):
|
||||
|
|
@ -240,3 +241,83 @@ def test_task_update_no_fields(runner):
|
|||
invoke(runner, ["task", "add", "p1", "Fix bug"])
|
||||
r = invoke(runner, ["task", "update", "P1-001"])
|
||||
assert r.exit_code != 0
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# hook
|
||||
# ===========================================================================
|
||||
|
||||
def test_hook_add_and_list(runner):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
r = invoke(runner, ["hook", "add",
|
||||
"--project", "p1",
|
||||
"--name", "rebuild",
|
||||
"--event", "pipeline_completed",
|
||||
"--command", "npm run build"])
|
||||
assert r.exit_code == 0
|
||||
assert "rebuild" in r.output
|
||||
assert "pipeline_completed" in r.output
|
||||
|
||||
r = invoke(runner, ["hook", "list", "--project", "p1"])
|
||||
assert r.exit_code == 0
|
||||
assert "rebuild" in r.output
|
||||
assert "npm run build" in r.output
|
||||
|
||||
|
||||
def test_hook_add_with_module_path(runner):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
r = invoke(runner, ["hook", "add",
|
||||
"--project", "p1",
|
||||
"--name", "fe-build",
|
||||
"--event", "pipeline_completed",
|
||||
"--command", "make build",
|
||||
"--module-path", "web/frontend/*",
|
||||
"--working-dir", "/tmp"])
|
||||
assert r.exit_code == 0
|
||||
r = invoke(runner, ["hook", "list", "--project", "p1"])
|
||||
assert "web/frontend/*" in r.output
|
||||
|
||||
|
||||
def test_hook_add_project_not_found(runner):
|
||||
r = invoke(runner, ["hook", "add",
|
||||
"--project", "nope",
|
||||
"--name", "x",
|
||||
"--event", "pipeline_completed",
|
||||
"--command", "echo hi"])
|
||||
assert r.exit_code == 1
|
||||
assert "not found" in r.output
|
||||
|
||||
|
||||
def test_hook_list_empty(runner):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
r = invoke(runner, ["hook", "list", "--project", "p1"])
|
||||
assert r.exit_code == 0
|
||||
assert "No hooks" in r.output
|
||||
|
||||
|
||||
def test_hook_remove(runner):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
invoke(runner, ["hook", "add",
|
||||
"--project", "p1",
|
||||
"--name", "rebuild",
|
||||
"--event", "pipeline_completed",
|
||||
"--command", "make"])
|
||||
r = invoke(runner, ["hook", "remove", "1"])
|
||||
assert r.exit_code == 0
|
||||
assert "Removed" in r.output
|
||||
|
||||
r = invoke(runner, ["hook", "list", "--project", "p1"])
|
||||
assert "No hooks" in r.output
|
||||
|
||||
|
||||
def test_hook_remove_not_found(runner):
|
||||
r = invoke(runner, ["hook", "remove", "999"])
|
||||
assert r.exit_code == 1
|
||||
assert "not found" in r.output
|
||||
|
||||
|
||||
def test_hook_logs_empty(runner):
|
||||
invoke(runner, ["project", "add", "p1", "P1", "/p1"])
|
||||
r = invoke(runner, ["hook", "logs", "--project", "p1"])
|
||||
assert r.exit_code == 0
|
||||
assert "No hook logs" in r.output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue