當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。