本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeAuthTokenRepo类的典型用法代码示例。如果您正苦于以下问题:Golang FakeAuthTokenRepo类的具体用法?Golang FakeAuthTokenRepo怎么用?Golang FakeAuthTokenRepo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeAuthTokenRepo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: callListServiceAuthTokens
func callListServiceAuthTokens(requirementsFactory *testreq.FakeReqFactory, authTokenRepo *testapi.FakeAuthTokenRepo) (ui *testterm.FakeUI) {
ui = &testterm.FakeUI{}
config := testconfig.NewRepositoryWithDefaults()
cmd := NewListServiceAuthTokens(ui, config, authTokenRepo)
testcmd.RunCommand(cmd, []string{}, requirementsFactory)
return
}
var _ = Describe("service-auth-tokens command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.ReadWriter
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) bool {
return testcmd.RunCommand(NewListServiceAuthTokens(ui, configRepo, authTokenRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例2:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/serviceauthtoken"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("update-service-auth-token command", func() {
var (
ui *testterm.FakeUI
configRepo configuration.ReadWriter
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) {
testcmd.RunCommand(NewUpdateServiceAuthToken(ui, configRepo, authTokenRepo), args, requirementsFactory)
}
Describe("requirements", func() {
示例3:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete-service-auth-token command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
authTokenRepo *testapi.FakeAuthTokenRepo
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceAuthTokenRepository(authTokenRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service-auth-token").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
authTokenRepo = &testapi.FakeAuthTokenRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()