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


Golang auth.Cancel函數代碼示例

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


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

示例1:

	. "github.com/onsi/gomega/gexec"
)

var _ = Describe("git push deis master", func() {

	Context("with an existing user", func() {

		var user model.User
		var keyPath string

		BeforeEach(func() {
			user = auth.Register()
		})

		AfterEach(func() {
			auth.Cancel(user)
		})

		Context("who has added their public key", func() {

			BeforeEach(func() {
				_, keyPath = keys.Add(user)
			})

			Context("and who has a local git repo containing buildpack source code", func() {

				BeforeEach(func() {
					output, err := cmd.Execute(`git clone https://github.com/deis/example-go.git`)
					Expect(err).NotTo(HaveOccurred(), output)
				})
開發者ID:sgoings,項目名稱:workflow-e2e,代碼行數:30,代碼來源:git_push_test.go

示例2:

			Eventually(sess).Should(Say("=== Administrators"))
			Eventually(sess).Should(Say(admin.Username))
			Expect(err).NotTo(HaveOccurred())
			Eventually(sess).Should(Exit(0))
		})

		Context("and another existing user", func() {

			var otherUser model.User

			BeforeEach(func() {
				otherUser = auth.Register()
			})

			AfterEach(func() {
				auth.Cancel(otherUser)
			})

			Specify("that admin can grant admin permissions to the other user", func() {
				sess, err := cmd.Start("deis perms:create %s --admin", &admin, otherUser.Username)
				Eventually(sess, settings.MaxEventuallyTimeout).Should(Say("Adding %s to system administrators... done\n", otherUser.Username))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess).Should(Exit(0))

				sess, err = cmd.Start("deis perms:list --admin", &admin)
				Eventually(sess).Should(Say("=== Administrators"))
				Eventually(sess).Should(Say(otherUser.Username))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess).Should(Exit(0))
			})
開發者ID:helgi,項目名稱:workflow-e2e,代碼行數:30,代碼來源:perms_test.go

示例3:

	. "github.com/onsi/gomega/gbytes"
	. "github.com/onsi/gomega/gexec"
)

var _ = Describe("deis apps", func() {

	Context("with an existing user", func() {

		var user model.User

		BeforeEach(func() {
			user = auth.Register()
		})

		AfterEach(func() {
			auth.Cancel(user)
		})

		Specify("that user can create an app without a git remote", func() {
			app := apps.Create(user, "--no-remote")
			apps.Destroy(user, app)
		})

		Specify("that user can create an app that uses a custom buildpack", func() {
			app := apps.Create(user, "--no-remote", "--buildpack https://weird-buildpacks.io/lisp")
			defer apps.Destroy(user, app)
			sess, err := cmd.Start("deis config:list -a %s", &user, app.Name)
			Eventually(sess).Should(Say("BUILDPACK_URL"))
			Expect(err).NotTo(HaveOccurred())
			Eventually(sess).Should(Exit(0))
		})
開發者ID:helgi,項目名稱:workflow-e2e,代碼行數:31,代碼來源:apps_test.go


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