当前位置: 首页>>代码示例>>Golang>>正文


Golang FakeResource.ReleaseCallCount方法代码示例

本文整理汇总了Golang中github.com/concourse/atc/resource/fakes.FakeResource.ReleaseCallCount方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeResource.ReleaseCallCount方法的具体用法?Golang FakeResource.ReleaseCallCount怎么用?Golang FakeResource.ReleaseCallCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/concourse/atc/resource/fakes.FakeResource的用法示例。


在下文中一共展示了FakeResource.ReleaseCallCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

					fakeTracker.InitWithSourcesStub = func(lager.Logger, resource.Metadata, resource.Session, resource.ResourceType, atc.Tags, map[string]resource.ArtifactSource, atc.ResourceTypes, worker.ImageFetchingDelegate) (resource.Resource, []string, error) {
						callCountDuringInit <- putDelegate.InitializingCallCount()
						return fakeResource, []string{"some-source", "some-other-source"}, nil
					}
				})

				It("calls the Initializing method on the delegate", func() {
					Expect(<-callCountDuringInit).To(Equal(1))
				})
			})

			Describe("releasing", func() {
				It("releases the resource with a ttl of 5 minutes", func() {
					<-process.Wait()

					Expect(fakeResource.ReleaseCallCount()).To(BeZero())

					step.Release()
					Expect(fakeResource.ReleaseCallCount()).To(Equal(1))
					Expect(fakeResource.ReleaseArgsForCall(0)).To(Equal(worker.FinalTTL(5 * time.Minute)))
				})
			})

			Describe("signalling", func() {
				var receivedSignals <-chan os.Signal

				BeforeEach(func() {
					sigs := make(chan os.Signal)
					receivedSignals = sigs

					fakeVersionedSource.RunStub = func(signals <-chan os.Signal, ready chan<- struct{}) error {
开发者ID:pcfdev-forks,项目名称:atc,代码行数:31,代码来源:put_step_test.go

示例2:

					It("is not successful", func() {
						Eventually(process.Wait()).Should(Receive(BeNil()))
						Ω(getDelegate.CompletedCallCount()).Should(Equal(1))

						var success Success

						Ω(step.Result(&success)).Should(BeTrue())
						Ω(bool(success)).Should(BeFalse())
					})
				})
			})

			Describe("releasing", func() {
				It("releases the resource", func() {
					Ω(fakeResource.ReleaseCallCount()).Should(BeZero())

					err := step.Release()
					Ω(err).ShouldNot(HaveOccurred())

					Ω(fakeResource.ReleaseCallCount()).Should(Equal(1))
				})
			})

			Describe("the source registered with the repository", func() {
				var artifactSource ArtifactSource

				JustBeforeEach(func() {
					Eventually(process.Wait()).Should(Receive(BeNil()))

					var found bool
开发者ID:savaki,项目名称:atc,代码行数:30,代码来源:dependent_get_step_test.go


注:本文中的github.com/concourse/atc/resource/fakes.FakeResource.ReleaseCallCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。