本文整理汇总了Golang中github.com/juju/juju/tools.List.URLs方法的典型用法代码示例。如果您正苦于以下问题:Golang List.URLs方法的具体用法?Golang List.URLs怎么用?Golang List.URLs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/tools.List
的用法示例。
在下文中一共展示了List.URLs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertToolsList
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: TestURLs
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: TestURLs
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},
})
}