18 lines
556 B
Python
18 lines
556 B
Python
from app.task_lifecycle import TaskLifecycle
|
|
|
|
|
|
def test_owner_approval_button_appears_for_waiting_task():
|
|
lifecycle = TaskLifecycle()
|
|
actions = lifecycle.available_actions({"task_id": "t1", "status": "waiting_approval"}, "owner")
|
|
approve = [a for a in actions if a["action"] == "approve"][0]
|
|
assert approve["enabled"] is True
|
|
|
|
|
|
def test_block_requires_reason():
|
|
lifecycle = TaskLifecycle()
|
|
try:
|
|
lifecycle.transition({"status": "running"}, "block", "executor")
|
|
assert False
|
|
except ValueError:
|
|
assert True
|