本文整理汇总了Golang中github.com/juju/juju/instance/testing.MatchInstances函数的典型用法代码示例。如果您正苦于以下问题:Golang MatchInstances函数的具体用法?Golang MatchInstances怎么用?Golang MatchInstances使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MatchInstances函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestListContainers
func (s *LxcSuite) TestListContainers(c *gc.C) {
foo := s.makeManager(c, "foo")
bar := s.makeManager(c, "bar")
foo1 := containertesting.CreateContainer(c, foo, "1/lxc/0")
foo2 := containertesting.CreateContainer(c, foo, "1/lxc/1")
foo3 := containertesting.CreateContainer(c, foo, "1/lxc/2")
bar1 := containertesting.CreateContainer(c, bar, "1/lxc/0")
bar2 := containertesting.CreateContainer(c, bar, "1/lxc/1")
result, err := foo.ListContainers()
c.Assert(err, gc.IsNil)
instancetest.MatchInstances(c, result, foo1, foo2, foo3)
result, err = bar.ListContainers()
c.Assert(err, gc.IsNil)
instancetest.MatchInstances(c, result, bar1, bar2)
}
示例2: assertInstances
func (s *lxcBrokerSuite) assertInstances(c *gc.C, inst ...instance.Instance) {
results, err := s.broker.AllInstances()
c.Assert(err, jc.ErrorIsNil)
instancetest.MatchInstances(c, results, inst...)
}
示例3: assertInstancesStarted
func assertInstancesStarted(c *gc.C, broker environs.InstanceBroker, results ...*environs.StartInstanceResult) {
allInstances, err := broker.AllInstances()
c.Assert(err, jc.ErrorIsNil)
instancetest.MatchInstances(c, allInstances, instancesFromResults(results...)...)
}