本文整理匯總了Golang中github.com/concourse/github-release-resource/fakes.FakeGitHub.UploadReleaseAssetStub方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeGitHub.UploadReleaseAssetStub方法的具體用法?Golang FakeGitHub.UploadReleaseAssetStub怎麽用?Golang FakeGitHub.UploadReleaseAssetStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/concourse/github-release-resource/fakes.FakeGitHub
的用法示例。
在下文中一共展示了FakeGitHub.UploadReleaseAssetStub方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
}
githubClient.ListReleaseAssetsReturns([]github.ReleaseAsset{
{
ID: github.Int(456789),
Name: github.String("great-file.tgz"),
},
{
ID: github.Int(3450798),
Name: github.String("whatever.tgz"),
},
}, nil)
githubClient.UploadReleaseAssetStub = func(github.RepositoryRelease, string, *os.File) error {
Expect(existingAsset).To(BeFalse())
existingAsset = true
return errors.New("some-error")
}
})
It("retries 10 times", func() {
_, err := command.Run(sourcesDir, request)
Expect(err).To(Equal(errors.New("some-error")))
Ω(githubClient.UploadReleaseAssetCallCount()).Should(Equal(10))
Ω(githubClient.ListReleaseAssetsCallCount()).Should(Equal(9))
Ω(*githubClient.ListReleaseAssetsArgsForCall(8).ID).Should(Equal(112))
actualRelease, actualName, actualFile := githubClient.UploadReleaseAssetArgsForCall(9)
Ω(*actualRelease.ID).Should(Equal(112))
Ω(actualName).Should(Equal("great-file.tgz"))