(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func 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 | |
| 68 | func TestCmdAddPlaybookProjectNotFound(t *testing.T) { |
| 69 | setupFlowRoot(t) |
nothing calls this directly
no test coverage detected