MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / TestLoadWorkflowJSON

Function TestLoadWorkflowJSON

internal/cli/workflow_test.go:63–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func TestLoadWorkflowJSON(t *testing.T) {
64 dir := t.TempDir()
65 path := filepath.Join(dir, "wf.json")
66 os.WriteFile(path, []byte(`{"steps":[{"pattern":"a"},{"pattern":"b"}]}`), 0o644)
67
68 wf, err := LoadWorkflow(path)
69 if err != nil {
70 t.Fatalf("unexpected error: %v", err)
71 }
72 if len(wf.Steps) != 2 || wf.Steps[1].Pattern != "b" {
73 t.Fatalf("unexpected steps: %+v", wf.Steps)
74 }
75}
76
77func TestLoadWorkflowBadPath(t *testing.T) {
78 tests := []struct {

Callers

nothing calls this directly

Calls 1

LoadWorkflowFunction · 0.85

Tested by

no test coverage detected