本文整理汇总了Golang中github.com/cloudfoundry-incubator/garden/client/connection/fakes.FakeConnection.BulkInfoReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeConnection.BulkInfoReturns方法的具体用法?Golang FakeConnection.BulkInfoReturns怎么用?Golang FakeConnection.BulkInfoReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry-incubator/garden/client/connection/fakes.FakeConnection
的用法示例。
在下文中一共展示了FakeConnection.BulkInfoReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
expectedBulkInfo := map[string]garden.ContainerInfoEntry{
"handle1": garden.ContainerInfoEntry{
Info: garden.ContainerInfo{
State: "container1State",
},
},
"handle2": garden.ContainerInfoEntry{
Info: garden.ContainerInfo{
State: "container1State",
},
},
}
handles := []string{"handle1", "handle2"}
It("gets info for the requested containers", func() {
fakeConnection.BulkInfoReturns(expectedBulkInfo, nil)
bulkInfo, err := client.BulkInfo(handles)
Ω(err).ShouldNot(HaveOccurred())
Ω(fakeConnection.BulkInfoCallCount()).Should(Equal(1))
Ω(fakeConnection.BulkInfoArgsForCall(0)).Should(Equal(handles))
Ω(bulkInfo).Should(Equal(expectedBulkInfo))
})
Context("when there is a error with the connection", func() {
expectedBulkInfo := map[string]garden.ContainerInfoEntry{}
BeforeEach(func() {
fakeConnection.BulkInfoReturns(expectedBulkInfo, errors.New("Oh noes!"))
})