本文整理匯總了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...)...)
}