(self)
| 1744 | assert result.next_steps[0]["id"] == "plan" |
| 1745 | |
| 1746 | def test_execute_falls_to_default(self): |
| 1747 | from specify_cli.workflows.steps.switch import SwitchStep |
| 1748 | from specify_cli.workflows.base import StepContext |
| 1749 | |
| 1750 | step = SwitchStep() |
| 1751 | ctx = StepContext( |
| 1752 | steps={"review": {"output": {"choice": "unknown"}}} |
| 1753 | ) |
| 1754 | config = { |
| 1755 | "id": "route", |
| 1756 | "expression": "{{ steps.review.output.choice }}", |
| 1757 | "cases": { |
| 1758 | "approve": [{"id": "plan", "command": "speckit.plan"}], |
| 1759 | }, |
| 1760 | "default": [{"id": "fallback", "type": "gate", "message": "Fallback"}], |
| 1761 | } |
| 1762 | result = step.execute(config, ctx) |
| 1763 | assert result.output["matched_case"] == "__default__" |
| 1764 | assert result.next_steps[0]["id"] == "fallback" |
| 1765 | |
| 1766 | def test_execute_no_default_no_match(self): |
| 1767 | from specify_cli.workflows.steps.switch import SwitchStep |
nothing calls this directly
no test coverage detected