本文整理汇总了Golang中github.com/cloudfoundry-incubator/receptor/fake_receptor.FakeClient.GetTaskCallCount方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeClient.GetTaskCallCount方法的具体用法?Golang FakeClient.GetTaskCallCount怎么用?Golang FakeClient.GetTaskCallCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry-incubator/receptor/fake_receptor.FakeClient
的用法示例。
在下文中一共展示了FakeClient.GetTaskCallCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Result: "some-result",
}
fakeReceptorClient.GetTaskReturns(getTaskResponse, nil)
})
It("returns a task status", func() {
taskInfo, err := taskExaminer.TaskStatus("boop")
Expect(err).ToNot(HaveOccurred())
Expect(taskInfo.TaskGuid).To(Equal("boop"))
Expect(taskInfo.State).To(Equal(receptor.TaskStateCompleted))
Expect(taskInfo.CellID).To(Equal("cell-01"))
Expect(taskInfo.Failed).To(BeFalse())
Expect(taskInfo.FailureReason).To(BeEmpty())
Expect(taskInfo.Result).To(Equal("some-result"))
Expect(fakeReceptorClient.GetTaskCallCount()).To(Equal(1))
Expect(fakeReceptorClient.GetTaskArgsForCall(0)).To(Equal("boop"))
})
Context("when the receptor returns errors", func() {
It("returns exists false for TaskNotFound", func() {
receptorError := receptor.Error{Type: receptor.TaskNotFound, Message: "could not locate this"}
fakeReceptorClient.GetTaskReturns(receptor.TaskResponse{}, receptorError)
_, err := taskExaminer.TaskStatus("boop1")
Expect(err).To(MatchError(task_examiner.TaskNotFoundErrorMessage))
})
It("bubbles up error for receptor Error anything but TaskNotFound", func() {
receptorError := receptor.Error{Type: receptor.TaskGuidAlreadyExists, Message: "could not locate this"}
fakeReceptorClient.GetTaskReturns(receptor.TaskResponse{}, receptorError)