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


Golang FakePipelineDB.GetConfigReturns方法代碼示例

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


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

示例1:

			Expect(pipelineDBFactory.BuildWithNameCallCount()).To(Equal(1))
			pipelineName := pipelineDBFactory.BuildWithNameArgsForCall(0)
			Expect(pipelineName).To(Equal("a-pipeline"))
		})

		Context("when getting the resource config succeeds", func() {
			BeforeEach(func() {
				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name:      "group-1",
							Resources: []string{"resource-1"},
						},
						{
							Name:      "group-2",
							Resources: []string{"resource-1", "resource-2"},
						},
					},

					Resources: []atc.ResourceConfig{
						{Name: "resource-1", Type: "type-1"},
						{Name: "resource-2", Type: "type-2"},
						{Name: "resource-3", Type: "type-3"},
					},
				}, 1, true, nil)
			})

			Context("when getting the check error succeeds", func() {
				BeforeEach(func() {
					pipelineDB.GetResourceStub = func(name string) (db.SavedResource, error) {
						if name == "resource-2" {
							return db.SavedResource{
開發者ID:ACPK,項目名稱:atc,代碼行數:32,代碼來源:resources_test.go

示例2:

					Name:   "some-resource",
					Type:   "git",
					Source: atc.Source{"uri": "git://some-resource"},
				},
				{
					Name:   "some-dependant-resource",
					Type:   "git",
					Source: atc.Source{"uri": "git://some-dependant-resource"},
				},
			},
		}

		pipelineDB.ScopedNameStub = func(thing string) string {
			return "pipeline:" + thing
		}
		pipelineDB.GetConfigReturns(initialConfig, 1, nil)

		lock = new(dbfakes.FakeLock)
		locker.AcquireWriteLockImmediatelyReturns(lock, nil)
	})

	JustBeforeEach(func() {
		process = ginkgomon.Invoke(&Runner{
			Logger:    lagertest.NewTestLogger("test"),
			Locker:    locker,
			DB:        pipelineDB,
			Scheduler: scheduler,
			Noop:      noop,
			Interval:  100 * time.Millisecond,
		})
	})
開發者ID:utako,項目名稱:atc,代碼行數:31,代碼來源:runner_test.go

示例3:

				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name: "group-1",
							Jobs: []string{"some-job"},
						},
						{
							Name: "group-2",
							Jobs: []string{"some-job"},
						},
					},

					Jobs: []atc.JobConfig{
						{
							Name: "some-job",
							Plan: atc.PlanSequence{
								{
									Get: "some-input",
								},
								{
									Get:      "some-name",
									Resource: "some-other-input",
									Params:   atc.Params{"secret": "params"},
									Passed:   []string{"a", "b"},
									Trigger:  true,
								},
								{
									Put: "some-output",
								},
								{
									Put:    "some-other-output",
									Params: atc.Params{"secret": "params"},
								},
							},
						},
					},
				}, 1, true, nil)
開發者ID:pcfdev-forks,項目名稱:atc,代碼行數:37,代碼來源:jobs_test.go

示例4:

				pipelineDB.GetConfigReturns(atc.Config{
					Groups: []atc.GroupConfig{
						{
							Name: "group-1",
							Jobs: []string{"some-job"},
						},
						{
							Name: "group-2",
							Jobs: []string{"some-job"},
						},
					},

					Jobs: []atc.JobConfig{
						{
							Name: "some-job",
							InputConfigs: []atc.JobInputConfig{
								{
									Resource: "some-input",
								},
								{
									RawName:  "some-name",
									Resource: "some-other-input",
									Params:   atc.Params{"secret": "params"},
									Passed:   []string{"a", "b"},
									Trigger:  true,
								},
							},
							OutputConfigs: []atc.JobOutputConfig{
								{
									Resource: "some-output",
								},
								{
									Resource:     "some-other-output",
									Params:       atc.Params{"secret": "params"},
									RawPerformOn: []atc.Condition{"failure"},
								},
							},
						},
					},
				}, 1, nil)
開發者ID:utako,項目名稱:atc,代碼行數:40,代碼來源:jobs_test.go


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