func assertToolsList(c *gc.C, list coretools.List, expected []version.Binary) { urls := list.URLs() c.Check(urls, gc.HasLen, len(expected)) for _, vers := range expected { c.Assert(urls[vers], gc.Not(gc.Equals), "") } }
func (s *ListSuite) TestURLs(c *gc.C) { empty := tools.List{} c.Check(empty.URLs(), gc.DeepEquals, map[version.Binary]string{}) full := tools.List{t100precise, t190quantal, t2001precise} c.Check(full.URLs(), gc.DeepEquals, map[version.Binary]string{ t100precise.Version: t100precise.URL, t190quantal.Version: t190quantal.URL, t2001precise.Version: t2001precise.URL, }) }
func (s *ListSuite) TestURLs(c *gc.C) { empty := tools.List{} c.Check(empty.URLs(), gc.DeepEquals, map[version.Binary][]string{}) alt := *t100quantal alt.URL = strings.Replace(alt.URL, "testing.invalid", "testing.invalid2", 1) full := tools.List{ t100precise, t190quantal, t100quantal, &alt, t2001precise, } c.Check(full.URLs(), gc.DeepEquals, map[version.Binary][]string{ t100precise.Version: []string{t100precise.URL}, t100quantal.Version: []string{t100quantal.URL, alt.URL}, t190quantal.Version: []string{t190quantal.URL}, t2001precise.Version: []string{t2001precise.URL}, }) }