MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdAddPlaybookWithProject

Function TestCmdAddPlaybookWithProject

internal/app/playbook_test.go:48–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestCmdAddPlaybookWithProject(t *testing.T) {
49 setupFlowRoot(t)
50 wd := t.TempDir()
51 if rc := cmdAdd([]string{"project", "CS Tools", "--slug", "cs-tools", "--work-dir", wd}); rc != 0 {
52 t.Fatal()
53 }
54
55 if rc := cmdAdd([]string{"playbook", "Triage", "--slug", "tri", "--work-dir", wd, "--project", "cs-tools"}); rc != 0 {
56 t.Fatalf("rc=%d", rc)
57 }
58 db := openFlowDB(t)
59 pb, err := flowdb.GetPlaybook(db, "tri")
60 if err != nil {
61 t.Fatal(err)
62 }
63 if !pb.ProjectSlug.Valid || pb.ProjectSlug.String != "cs-tools" {
64 t.Errorf("project_slug: got %+v", pb.ProjectSlug)
65 }
66}
67
68func TestCmdAddPlaybookProjectNotFound(t *testing.T) {
69 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 4

GetPlaybookFunction · 0.92
setupFlowRootFunction · 0.85
cmdAddFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected