예제 #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},
	})
}