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

Function TestLoadWorkflowBadPath

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

Source from the content-addressed store, hash-verified

75}
76
77func TestLoadWorkflowBadPath(t *testing.T) {
78 tests := []struct {
79 name string
80 path string
81 }{
82 {"absolute missing", "/definitely/does/not/exist.yaml"},
83 {"relative missing", "./missing_workflow.yaml"},
84 {"directory not file", t.TempDir()},
85 }
86 for _, tc := range tests {
87 t.Run(tc.name, func(t *testing.T) {
88 _, err := LoadWorkflow(tc.path)
89 if err == nil {
90 t.Fatalf("expected error for %q, got nil", tc.path)
91 }
92 if !strings.Contains(err.Error(), "workflow") {
93 t.Errorf("error %q should mention 'workflow'", err.Error())
94 }
95 })
96 }
97}
98
99func TestLoadWorkflowMalformedYAML(t *testing.T) {
100 dir := t.TempDir()

Callers

nothing calls this directly

Calls 2

LoadWorkflowFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected