本文整理汇总了Golang中github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud.DeleteVMErr方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeCloud.DeleteVMErr方法的具体用法?Golang FakeCloud.DeleteVMErr怎么用?Golang FakeCloud.DeleteVMErr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud
的用法示例。
在下文中一共展示了FakeCloud.DeleteVMErr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
It("deletes VM in the vm repo", func() {
err := vm.Delete()
Expect(err).ToNot(HaveOccurred())
Expect(fakeVMRepo.ClearCurrentCalled).To(BeTrue())
})
It("clears current stemcell in the stemcell repo", func() {
err := vm.Delete()
Expect(err).ToNot(HaveOccurred())
Expect(fakeStemcellRepo.ClearCurrentCalled).To(BeTrue())
})
Context("when deleting vm in the cloud fails", func() {
BeforeEach(func() {
fakeCloud.DeleteVMErr = errors.New("fake-delete-vm-error")
})
It("returns an error", func() {
err := vm.Delete()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-delete-vm-error"))
})
})
Context("when deleting vm in the cloud fails with VMNotFoundError", func() {
var deleteErr = bicloud.NewCPIError("delete_vm", bicloud.CmdError{
Type: bicloud.VMNotFoundError,
Message: "fake-vm-not-found-message",
})