本文整理匯總了Golang中github.com/concourse/baggageclaim/fakes.FakeClient.CreateVolumeStub方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeClient.CreateVolumeStub方法的具體用法?Golang FakeClient.CreateVolumeStub怎麽用?Golang FakeClient.CreateVolumeStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/concourse/baggageclaim/fakes.FakeClient
的用法示例。
在下文中一共展示了FakeClient.CreateVolumeStub方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
cowVolume1 = new(bfakes.FakeVolume)
cowVolume1.HandleReturns("cow-volume1")
cowVolume1.PathReturns("/some/cow/src/path")
cowVolume2 = new(bfakes.FakeVolume)
cowVolume2.HandleReturns("cow-volume2")
cowVolume2.PathReturns("/some/other/cow/src/path")
fakeBaggageclaimClient.CreateVolumeStub = func(logger lager.Logger, spec baggageclaim.VolumeSpec) (baggageclaim.Volume, error) {
Expect(spec.Privileged).To(BeTrue())
Expect(spec.TTL).To(Equal(5 * time.Minute))
if reflect.DeepEqual(spec.Strategy, baggageclaim.COWStrategy{Parent: volume1}) {
return cowVolume1, nil
} else if reflect.DeepEqual(spec.Strategy, baggageclaim.COWStrategy{Parent: volume2}) {
return cowVolume2, nil
} else {
Fail(fmt.Sprintf("unknown strategy: %#v", spec.Strategy))
return nil, nil
}
}
})
It("creates the container with read-write copy-on-write bind-mounts for each cache", func() {
Expect(fakeGardenClient.CreateCallCount()).To(Equal(1))
spec := fakeGardenClient.CreateArgsForCall(0)
Expect(spec.RootFSPath).To(Equal("some-resource-image"))
Expect(spec.Privileged).To(BeTrue())
Expect(spec.BindMounts).To(Equal([]garden.BindMount{