當前位置: 首頁>>代碼示例>>Golang>>正文


Golang FakeCmdRunner.AddProcess方法代碼示例

本文整理匯總了Golang中bosh/system/fakes.FakeCmdRunner.AddProcess方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeCmdRunner.AddProcess方法的具體用法?Golang FakeCmdRunner.AddProcess怎麽用?Golang FakeCmdRunner.AddProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bosh/system/fakes.FakeCmdRunner的用法示例。


在下文中一共展示了FakeCmdRunner.AddProcess方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1:

	Describe("Run", func() {
		Context("when apply spec is successfully retrieved", func() {
			Context("when current agent has a job spec template", func() {
				BeforeEach(func() {
					currentSpec := boshas.V1ApplySpec{}
					currentSpec.JobSpec.Template = "fake-job-name"
					specService.Spec = currentSpec
				})

				Context("when errand script exits with non-0 exit code (execution of script is ok)", func() {
					BeforeEach(func() {
						cmdRunner.AddProcess("/fake-jobs-dir/fake-job-name/bin/run", &fakesys.FakeProcess{
							WaitResult: boshsys.Result{
								Stdout:     "fake-stdout",
								Stderr:     "fake-stderr",
								ExitStatus: 0,
							},
						})
					})

					It("returns errand result without error after running an errand", func() {
						result, err := action.Run()
						Expect(err).ToNot(HaveOccurred())
						Expect(result).To(Equal(
							ErrandResult{
								Stdout:     "fake-stdout",
								Stderr:     "fake-stderr",
								ExitStatus: 0,
							},
						))
開發者ID:Jane4PKU,項目名稱:bosh,代碼行數:30,代碼來源:run_errand_test.go


注:本文中的bosh/system/fakes.FakeCmdRunner.AddProcess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。