本文整理汇总了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