当前位置: 首页>>代码示例>>Golang>>正文


Golang testhelpers.RunCommand函数代码示例

本文整理汇总了Golang中testhelpers.RunCommand函数的典型用法代码示例。如果您正苦于以下问题:Golang RunCommand函数的具体用法?Golang RunCommand怎么用?Golang RunCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RunCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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)
}
开发者ID:jbayer,项目名称:cli,代码行数:27,代码来源:push_test.go

示例2: 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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:orgs_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:rename_org_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:logs_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:rename_space_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:bind_service_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:7,代码来源:rename_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:recent_logs_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:files_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:env_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:create_org_test.go

示例12: 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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:app_test.go

示例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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:unset_env_test.go

示例14: callRestart

func callRestart(args []string, reqFactory *testhelpers.FakeReqFactory, starter ApplicationStarter, stopper ApplicationStopper) (ui *testhelpers.FakeUI) {
	ui = new(testhelpers.FakeUI)
	ctxt := testhelpers.NewContext("restart", args)

	cmd := NewRestart(ui, starter, stopper)
	testhelpers.RunCommand(cmd, ctxt, reqFactory)
	return
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:restart_test.go

示例15: 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
}
开发者ID:jbayer,项目名称:cli,代码行数:8,代码来源:spaces_test.go


注:本文中的testhelpers.RunCommand函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。