(self, tmp_path)
| 1185 | |
| 1186 | |
| 1187 | def test_output_format_json_exposes_data(self, tmp_path): |
| 1188 | from specify_cli.workflows.steps.shell import ShellStep |
| 1189 | from specify_cli.workflows.base import StepContext, StepStatus |
| 1190 | |
| 1191 | step = ShellStep() |
| 1192 | ctx = StepContext(project_root=str(tmp_path)) |
| 1193 | config = { |
| 1194 | "id": "emit", |
| 1195 | "run": self._python_run( |
| 1196 | tmp_path, 'import json; print(json.dumps({"items": [1, 2]}))\n' |
| 1197 | ), |
| 1198 | "output_format": "json", |
| 1199 | } |
| 1200 | result = step.execute(config, ctx) |
| 1201 | assert result.status == StepStatus.COMPLETED |
| 1202 | assert result.output["data"] == {"items": [1, 2]} |
| 1203 | assert result.output["exit_code"] == 0 # raw keys still present |
| 1204 | |
| 1205 | def test_output_format_json_invalid_stdout_fails(self, tmp_path): |
| 1206 | from specify_cli.workflows.steps.shell import ShellStep |
nothing calls this directly
no test coverage detected