func addCharm(c *gc.C, st *State, series string, ch charm.Charm) *Charm { ident := fmt.Sprintf("%s-%s-%d", series, ch.Meta().Name, ch.Revision()) curl := charm.MustParseURL("local:" + series + "/" + ident) bundleURL, err := url.Parse("http://bundles.testing.invalid/" + ident) c.Assert(err, gc.IsNil) sch, err := st.AddCharm(ch, curl, bundleURL, ident+"-sha256") c.Assert(err, gc.IsNil) return sch }
func checkDummy(c *gc.C, f charm.Charm, path string) { c.Assert(f.Revision(), gc.Equals, 1) c.Assert(f.Meta().Name, gc.Equals, "dummy") c.Assert(f.Config().Options["title"].Default, gc.Equals, "My Title") switch f := f.(type) { case *charm.Bundle: c.Assert(f.Path, gc.Equals, path) case *charm.Dir: c.Assert(f.Path, gc.Equals, path) } }