本文整理匯總了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{
示例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,
})
})
示例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)
示例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)