// Lists apps or fails. func mustAppList(t testing.TB, c *heroku.Client) []heroku.App { apps, err := c.AppList(nil) if err != nil { t.Fatal(err) } return apps }
func mustFormationBatchUpdate(t testing.TB, c *heroku.Client, appName string, updates []heroku.FormationBatchUpdateOpts) []heroku.Formation { f, err := c.FormationBatchUpdate(appName, updates, "") if err != nil { t.Fatal(err) } return f }
func mustReleaseRollback(t testing.TB, c *heroku.Client, appName string, version string) *heroku.Release { release, err := c.ReleaseRollback(appName, version, "") if err != nil { t.Fatal(err) } return release }
func mustReleaseList(t testing.TB, c *heroku.Client, appName string) []heroku.Release { releases, err := c.ReleaseList(appName, nil) if err != nil { t.Fatal(err) } return releases }
func mustConfigVarInfo(t testing.TB, c *heroku.Client, appName string) map[string]string { vars, err := c.ConfigVarInfo(appName) if err != nil { t.Fatal(err) } return vars }
func mustConfigVarUpdate(t testing.TB, c *heroku.Client, appName string, options map[string]*string) map[string]string { vars, err := c.ConfigVarUpdate(appName, options, "") if err != nil { t.Fatal(err) } return vars }
func mustDeploy(t testing.TB, c *heroku.Client, image string) { var ( f DeployForm ) f.Image = image if err := c.Post(ioutil.Discard, "/deploys", &f); err != nil { t.Fatal(err) } }
// Deploys an image for the app or fails. func mustAppDeploy(t testing.TB, c *heroku.Client, appName string, image string) { var ( f DeployForm ) f.Image = image endpoint := fmt.Sprintf("/apps/%s/deploys", appName) if err := c.Post(ioutil.Discard, endpoint, &f); err != nil { t.Fatal(err) } }
// Creates an app or fails. func mustOrganizationAppCreate(t testing.TB, c *heroku.Client, app empire.App) *heroku.OrganizationApp { name := string(app.Name) opts := heroku.OrganizationAppCreateOpts{ Name: &name, } a, err := c.OrganizationAppCreate(&opts) if err != nil { t.Fatal(err) } return a }
// Delets an app or fails. func mustAppDelete(t testing.TB, c *heroku.Client, appName string) { if err := c.AppDelete(appName); err != nil { t.Fatal(err) } }