示例#1
0
文件: sync_test.go 项目: zhouqt/juju
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), "")
	}
}
示例#2
0
文件: list_test.go 项目: jiasir/juju
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,
	})
}
示例#3
0
文件: list_test.go 项目: bac/juju
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},
	})
}