本文整理匯總了Golang中github.com/cloudfoundry/hm9000/store.Store.IsDesiredStateFresh方法的典型用法代碼示例。如果您正苦於以下問題:Golang Store.IsDesiredStateFresh方法的具體用法?Golang Store.IsDesiredStateFresh怎麽用?Golang Store.IsDesiredStateFresh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/hm9000/store.Store
的用法示例。
在下文中一共展示了Store.IsDesiredStateFresh方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
Ω(request.Header.Get("Authorization")).Should(Equal(expectedAuth))
})
It("should request a batch size with an empty bulk token", func() {
query := httpClient.LastRequest().URL.Query()
Ω(query.Get("batch_size")).Should(Equal(fmt.Sprintf("%d", conf.DesiredStateBatchSize)))
Ω(query.Get("bulk_token")).Should(Equal("{}"))
})
assertFailure := func(expectedMessage string, numRequests int) {
It("should stop requesting batches", func() {
Ω(httpClient.Requests).Should(HaveLen(numRequests))
})
It("should not bump the freshness", func() {
fresh, _ := store.IsDesiredStateFresh()
Ω(fresh).Should(BeFalse())
})
It("should send an error down the result channel", func(done Done) {
result := <-resultChan
Ω(result.Success).Should(BeFalse())
Ω(result.Message).Should(Equal(expectedMessage))
Ω(result.Error).Should(HaveOccurred())
close(done)
}, 1.0)
}
Context("when a response with desired state is received", func() {
var (
a1 appfixture.AppFixture