MCPcopy
hub / github.com/github/spec-kit / test_output_format_json_exposes_data

Method test_output_format_json_exposes_data

tests/test_workflows.py:1187–1203  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

_python_runMethod · 0.95
executeMethod · 0.95
ShellStepClass · 0.90
StepContextClass · 0.90

Tested by

no test coverage detected