本文整理汇总了Golang中testhelpers.NewContext函数的典型用法代码示例。如果您正苦于以下问题:Golang NewContext函数的具体用法?Golang NewContext怎么用?Golang NewContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: callOrgs
func callOrgs(reqFactory *testhelpers.FakeReqFactory, orgRepo *testhelpers.FakeOrgRepository) (fakeUI *testhelpers.FakeUI) {
fakeUI = &testhelpers.FakeUI{}
ctxt := testhelpers.NewContext("orgs", []string{})
cmd := NewListOrganizations(fakeUI, orgRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例2: TestPushingRequirements
func TestPushingRequirements(t *testing.T) {
fakeUI := new(testhelpers.FakeUI)
starter := &testhelpers.FakeAppStarter{}
stopper := &testhelpers.FakeAppStopper{}
zipper := &testhelpers.FakeZipper{}
appRepo := &testhelpers.FakeApplicationRepository{}
domainRepo := &testhelpers.FakeDomainRepository{}
routeRepo := &testhelpers.FakeRouteRepository{}
stackRepo := &testhelpers.FakeStackRepository{}
cmd := NewPush(fakeUI, starter, stopper, zipper, appRepo, domainRepo, routeRepo, stackRepo)
ctxt := testhelpers.NewContext("push", []string{})
reqFactory := &testhelpers.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
testhelpers.RunCommand(cmd, ctxt, reqFactory)
assert.True(t, testhelpers.CommandDidPassRequirements)
reqFactory = &testhelpers.FakeReqFactory{LoginSuccess: false, TargetedSpaceSuccess: true}
testhelpers.RunCommand(cmd, ctxt, reqFactory)
assert.False(t, testhelpers.CommandDidPassRequirements)
testhelpers.CommandDidPassRequirements = true
reqFactory = &testhelpers.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: false}
testhelpers.RunCommand(cmd, ctxt, reqFactory)
assert.False(t, testhelpers.CommandDidPassRequirements)
}
示例3: callRenameOrg
func callRenameOrg(args []string, reqFactory *testhelpers.FakeReqFactory, orgRepo *testhelpers.FakeOrgRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("rename-org", args)
cmd := NewRenameOrg(ui, orgRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例4: callLogs
func callLogs(args []string, reqFactory *testhelpers.FakeReqFactory, logsRepo *testhelpers.FakeLogsRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("logs", args)
cmd := NewLogs(ui, logsRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例5: callRenameSpace
func callRenameSpace(args []string, reqFactory *testhelpers.FakeReqFactory, spaceRepo *testhelpers.FakeSpaceRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("create-space", args)
cmd := NewRenameSpace(ui, spaceRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例6: callBindService
func callBindService(args []string, reqFactory *testhelpers.FakeReqFactory, serviceRepo api.ServiceRepository) (fakeUI *testhelpers.FakeUI) {
fakeUI = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("bind-service", args)
cmd := NewBindService(fakeUI, serviceRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例7: callRename
func callRename(args []string, reqFactory *testhelpers.FakeReqFactory, appRepo *testhelpers.FakeApplicationRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("rename", args)
cmd := NewRename(ui, appRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例8: callRecentLogs
func callRecentLogs(args []string, config *configuration.Configuration, reqFactory *testhelpers.FakeReqFactory, appRepo api.ApplicationRepository, logsRepo api.LogsRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("logs", args)
cmd := NewRecentLogs(ui, appRepo, logsRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例9: callFiles
func callFiles(args []string, reqFactory *testhelpers.FakeReqFactory, appFilesRepo *testhelpers.FakeAppFilesRepo) (ui *testhelpers.FakeUI) {
ui = &testhelpers.FakeUI{}
ctxt := testhelpers.NewContext("files", args)
cmd := NewFiles(ui, appFilesRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例10: callEnv
func callEnv(args []string, reqFactory *testhelpers.FakeReqFactory) (ui *testhelpers.FakeUI) {
ui = &testhelpers.FakeUI{}
ctxt := testhelpers.NewContext("env", args)
cmd := NewEnv(ui)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例11: callCreateOrganization
func callCreateOrganization(args []string, reqFactory *testhelpers.FakeReqFactory, orgRepo *testhelpers.FakeOrgRepository) (fakeUI *testhelpers.FakeUI) {
fakeUI = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("create-org", args)
cmd := NewCreateOrganization(fakeUI, orgRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例12: callSpaces
func callSpaces(args []string, reqFactory *testhelpers.FakeReqFactory, config *configuration.Configuration, spaceRepo api.SpaceRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("spaces", args)
cmd := NewSpaces(ui, config, spaceRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例13: callUnsetEnv
func callUnsetEnv(args []string, reqFactory *testhelpers.FakeReqFactory, appRepo api.ApplicationRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("unset-env", args)
cmd := NewUnsetEnv(ui, appRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例14: callApp
func callApp(args []string, reqFactory *testhelpers.FakeReqFactory, appSummaryRepo *testhelpers.FakeAppSummaryRepo) (ui *testhelpers.FakeUI) {
ui = &testhelpers.FakeUI{}
ctxt := testhelpers.NewContext("app", args)
cmd := NewApp(ui, appSummaryRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}
示例15: callStart
func callStart(args []string, config *configuration.Configuration, reqFactory *testhelpers.FakeReqFactory, appRepo api.ApplicationRepository) (ui *testhelpers.FakeUI) {
ui = new(testhelpers.FakeUI)
ctxt := testhelpers.NewContext("start", args)
cmd := NewStart(ui, config, appRepo)
testhelpers.RunCommand(cmd, ctxt, reqFactory)
return
}