MCPcopy Index your code
hub / github.com/github/spec-kit / test_load_valid_custom_step

Method test_load_valid_custom_step

tests/test_workflows.py:5060–5090  ·  view source on GitHub ↗
(self, project_dir)

Source from the content-addressed store, hash-verified

5058 assert loaded == []
5059
5060 def test_load_valid_custom_step(self, project_dir):
5061 from specify_cli.workflows import load_custom_steps, STEP_REGISTRY
5062
5063 step_dir = project_dir / ".specify" / "workflows" / "steps" / "test-custom"
5064 step_dir.mkdir(parents=True)
5065
5066 step_yml = """
5067schema_version: "1.0"
5068step:
5069 type_key: "test-custom"
5070 name: "Test Custom Step"
5071 version: "1.0.0"
5072 author: "test"
5073 description: "A test custom step"
5074"""
5075 (step_dir / "step.yml").write_text(step_yml, encoding="utf-8")
5076
5077 init_py = """
5078from specify_cli.workflows.base import StepBase, StepResult
5079
5080class TestCustomStep(StepBase):
5081 type_key = "test-custom"
5082
5083 def execute(self, config, context):
5084 return StepResult()
5085"""
5086 (step_dir / "__init__.py").write_text(init_py, encoding="utf-8")
5087
5088 loaded = load_custom_steps(project_dir)
5089 assert "test-custom" in loaded
5090 assert "test-custom" in STEP_REGISTRY
5091
5092 def test_skip_missing_step_yml(self, project_dir):
5093 from specify_cli.workflows import load_custom_steps

Callers

nothing calls this directly

Calls 1

load_custom_stepsFunction · 0.90

Tested by

no test coverage detected