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


Golang utils.GetGlobalConfig函數代碼示例

本文整理匯總了Golang中github.com/deis/deis/tests/utils.GetGlobalConfig函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetGlobalConfig函數的具體用法?Golang GetGlobalConfig怎麽用?Golang GetGlobalConfig使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: TestUsers

func TestUsers(t *testing.T) {
	params := utils.GetGlobalConfig()
	user := utils.GetGlobalConfig()
	user.UserName, user.Password = "user-list-test", "test"
	user.AppName = params.AppName
	utils.Execute(t, authRegisterCmd, user, false, "")
	usersListTest(t, params, user)
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:8,代碼來源:users_test.go

示例2: authCancel

func authCancel(t *testing.T, params *utils.DeisTestConfig) {
	utils.Execute(t, authCancelCmd, params, false, "Account cancelled")
	user := utils.GetGlobalConfig()

	// Admins can delete other users.
	user.UserName, user.Password = "cancel-test", "test"
	utils.Execute(t, authRegisterCmd, user, false, "")
	admin := utils.GetGlobalConfig()
	utils.Execute(t, authLoginCmd, admin, false, "")
	utils.Execute(t, authCancelAdminCmd, user, false, "Account cancelled")
	// Make sure the user's config was not purged after auth:cancel --username
	utils.Execute(t, authWhoamiCmd, admin, false, "You are "+admin.UserName)
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:13,代碼來源:auth_test.go

示例3: authCancel

func authCancel(t *testing.T, params *utils.DeisTestConfig) {
	utils.Execute(t, authCancelCmd, params, false, "Account cancelled")
	user := utils.GetGlobalConfig()

	// Admins can delete other users.
	user.UserName, user.Password = "cancel-test", "test"
	utils.Execute(t, authRegisterCmd, user, false, "")
	admin := utils.GetGlobalConfig()
	utils.Execute(t, authLoginCmd, admin, false, "")
	utils.Execute(t, authCancelAdminCmd, user, false, "Account cancelled")
	// Make sure the admin is still logged in
	utils.CheckList(t, authWhoamiCmd, admin, admin.UserName, false)
}
開發者ID:laurrentt,項目名稱:deis,代碼行數:13,代碼來源:auth_test.go

示例4: appsSetup

func appsSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.AppName = "appssample"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	utils.Execute(t, gitCloneCmd, cfg, false, "")
	return cfg
}
開發者ID:gdestuynder,項目名稱:deis,代碼行數:7,代碼來源:apps_test.go

示例5: TestSmokeExampleApp

// TestSmokeExampleApp updates a Vagrant instance to run Deis with docker
// containers using the current codebase, then registers a user, pushes an
// example app, and looks for "Powered by Deis" in the HTTP response.
func TestSmokeExampleApp(t *testing.T) {
	cfg := utils.GetGlobalConfig()

	for _, tt := range smokeTests {
		runTest(t, &tt, cfg)
	}
}
開發者ID:bdemers,項目名稱:deis,代碼行數:10,代碼來源:smoke_test.go

示例6: configSetup

func configSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.AppName = "configsample"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	utils.Execute(t, gitCloneCmd, cfg, false, "")
	if err := utils.Chdir(cfg.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, appsCreateCmd, cfg, false, "")
	// ensure envvars with spaces work fine on `git push`
	// https://github.com/deis/deis/issues/2477
	utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
	// ensure custom buildpack URLs are in order
	url := buildpacks[cfg.ExampleApp]
	if url == "" {
		// set url anyway so example-dockerfile apps create a build
		url = buildpacks["example-go"]
	}
	cmd := strings.Replace(configSetBuildpackCmd, "$BUILDPACK_URL", url, 1)
	utils.Execute(t, cmd, cfg, false, url)
	utils.Execute(t, gitPushCmd, cfg, false, "")
	utils.CurlApp(t, *cfg)
	utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_APP", false)
	utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_RELEASE", false)
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	return cfg
}
開發者ID:gpxl,項目名稱:deis,代碼行數:29,代碼來源:config_test.go

示例7: TestGlobal

func TestGlobal(t *testing.T) {
	params := utils.GetGlobalConfig()
	cookieTest(t, params)
	utils.Execute(t, authRegisterCmd, params, false, "")
	utils.Execute(t, keysAddCmd, params, false, "")
	utils.Execute(t, clustersCreateCmd, params, false, "")
}
開發者ID:bdemers,項目名稱:deis,代碼行數:7,代碼來源:integration_test.go

示例8: TestPerms

func TestPerms(t *testing.T) {
	params := permsSetup(t)
	user := utils.GetGlobalConfig()
	user.UserName, user.Password = "test1", "test1"
	user.AppName = params.AppName
	utils.Execute(t, authRegisterCmd, user, false, "")
	permsCreateAppTest(t, params, user)
	permsDeleteAppTest(t, params, user)
	permsCreateAdminTest(t, params)
	permsDeleteAdminTest(t, params)
	utils.AppsDestroyTest(t, params)
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:12,代碼來源:perms_test.go

示例9: authRegenerateTest

func authRegenerateTest(t *testing.T) {
	params := utils.GetGlobalConfig()
	regenCmd := authRegenerateUsrCmd
	loginCmd := authLoginCmd

	utils.Execute(t, loginCmd, params, false, "")
	utils.Execute(t, authRegenerateCmd, params, false, "")
	utils.Execute(t, loginCmd, params, false, "")
	utils.Execute(t, regenCmd, params, false, "")
	utils.Execute(t, checkTokenCmd, params, true, "401 UNAUTHORIZED")
	utils.Execute(t, loginCmd, params, false, "")
	utils.Execute(t, authRegenerateAllCmd, params, false, "")
	utils.Execute(t, checkTokenCmd, params, true, "401 UNAUTHORIZED")
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:14,代碼來源:auth_test.go

示例10: appsTransferTest

func appsTransferTest(t *testing.T, params *utils.DeisTestConfig) {
	user := utils.GetGlobalConfig()
	user.UserName, user.Password = "app-transfer-test", "test"
	user.AppName = "transfer-test"
	user.NewOwner = params.UserName
	utils.Execute(t, authRegisterCmd, user, false, "")
	utils.Execute(t, authLoginCmd, user, false, "")
	utils.Execute(t, appsCreateCmdNoRemote, user, false, "")
	utils.Execute(t, appsTransferCmd, user, false, "")
	utils.Execute(t, appsInfoCmd, user, true, "403 FORBIDDEN")
	utils.Execute(t, authLoginCmd, params, false, "")
	params.AppName = user.AppName
	utils.CheckList(t, appsInfoCmd, params, params.UserName, false)
}
開發者ID:yun-an,項目名稱:deis,代碼行數:14,代碼來源:apps_test.go

示例11: psSetup

func psSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.AppName = "pssample"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	utils.Execute(t, gitCloneCmd, cfg, false, "")
	if err := utils.Chdir(cfg.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, appsCreateCmd, cfg, false, "")
	utils.Execute(t, gitPushCmd, cfg, false, "")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	return cfg
}
開發者ID:ericcapricorn,項目名稱:deis,代碼行數:15,代碼來源:ps_test.go

示例12: buildSetup

func buildSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.AppName = "buildsample"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	utils.Execute(t, gitCloneCmd, cfg, false, "")
	if err := utils.Chdir(cfg.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, appsCreateCmd, cfg, false, "")
	utils.Execute(t, gitPushCmd, cfg, false, "")
	utils.Execute(t, "git commit --allow-empty -m bump", cfg, false, "")
	utils.Execute(t, gitPushCmd, cfg, false, "")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	return cfg
}
開發者ID:ericcapricorn,項目名稱:deis,代碼行數:17,代碼來源:builds_test.go

示例13: configSetup

func configSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.AppName = "configsample"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	utils.Execute(t, gitCloneCmd, cfg, false, "")
	if err := utils.Chdir(cfg.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, appsCreateCmd, cfg, false, "")
	// ensure envvars with spaces work fine on `git push`
	// https://github.com/deis/deis/issues/2477
	utils.Execute(t, configSet3Cmd, cfg, false, "the Deis team")
	utils.Execute(t, gitPushCmd, cfg, false, "")
	utils.CurlWithFail(t, cfg, false, "the Deis team")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
	return cfg
}
開發者ID:gdestuynder,項目名稱:deis,代碼行數:19,代碼來源:config_test.go

示例14: clustersSetup

func clustersSetup(t *testing.T) *utils.DeisTestConfig {
	cfg := utils.GetGlobalConfig()
	cfg.ClusterName = "devtest"
	utils.Execute(t, authLoginCmd, cfg, false, "")
	return cfg
}
開發者ID:bdemers,項目名稱:deis,代碼行數:6,代碼來源:clusters_test.go

示例15: TestGlobal

func TestGlobal(t *testing.T) {
	params := utils.GetGlobalConfig()
	utils.Execute(t, authRegisterCmd, params, false, "")
	clientTest(t, params)
	utils.Execute(t, keysAddCmd, params, false, "")
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:6,代碼來源:integration_test.go


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