本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/requirements/requirementsfakes.FakeFactory類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeFactory類的具體用法?Golang FakeFactory怎麽用?Golang FakeFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
"github.com/cloudfoundry/cli/flags"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/service"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("marketplace command", func() {
var ui *testterm.FakeUI
var requirementsFactory *requirementsfakes.FakeFactory
var config coreconfig.Repository
var serviceBuilder *servicebuilderfakes.FakeServiceBuilder
var fakeServiceOfferings []models.ServiceOffering
var serviceWithAPaidPlan models.ServiceOffering
var service2 models.ServiceOffering
var deps commandregistry.Dependency
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.ServiceBuilder = serviceBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("marketplace").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
示例2:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/trace/tracefakes"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("SSH command", func() {
var (
ui *testterm.FakeUI
sshCodeGetter *commandsfakes.FakeSSHCodeGetter
originalSSHCodeGetter commandregistry.Command
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
ccGateway net.Gateway
fakeSecureShell *sshfakes.FakeSecureShell
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
deps.Gateways = make(map[string]net.Gateway)
//save original command and restore later
originalSSHCodeGetter = commandregistry.Commands.FindCommand("ssh-code")
示例3:
"github.com/cloudfoundry/cli/cf/terminal"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/route"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("routes command", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
domainRepo *apifakes.FakeDomainRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo).SetDomainRepository(domainRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("routes").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例4:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commands/spacequota"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("quotas command", func() {
var (
ui *testterm.FakeUI
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
configRepo coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetSpaceQuotaRepository(quotaRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("space-quotas").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
quotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository)
requirementsFactory = new(requirementsfakes.FakeFactory)
示例5:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnsetSpaceRole", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
userRepo *apifakes.FakeUserRepository
spaceRepo *apifakes.FakeSpaceRepository
flagRepo *featureflagsfakes.FakeFeatureFlagRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
userRequirement *requirementsfakes.FakeUserRequirement
organizationRequirement *requirementsfakes.FakeOrganizationRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
userRepo = new(apifakes.FakeUserRepository)
repoLocator := deps.RepoLocator.SetUserRepository(userRepo)
spaceRepo = new(apifakes.FakeSpaceRepository)
repoLocator = repoLocator.SetSpaceRepository(spaceRepo)
示例6:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("OneTimeSSHCode", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
authRepo *authenticationfakes.FakeRepository
endpointRepo *coreconfigfakes.FakeEndpointRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
endpointRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
configRepo.SetAPIEndpoint("fake-api-endpoint")
endpointRepo = new(coreconfigfakes.FakeEndpointRepository)
repoLocator := deps.RepoLocator.SetEndpointRepository(endpointRepo)
authRepo = new(authenticationfakes.FakeRepository)
示例7: failedUpdate
))
}
func failedUpdate(ui *testterm.FakeUI, buildpackName string) {
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"Updating buildpack", buildpackName},
[]string{"FAILED"},
))
}
var _ = Describe("Updating buildpack command", func() {
var (
requirementsFactory *requirementsfakes.FakeFactory
ui *testterm.FakeUI
repo *apifakes.OldFakeBuildpackRepository
bitsRepo *apifakes.OldFakeBuildpackBitsRepository
deps commandregistry.Dependency
buildpackName string
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(repo)
deps.RepoLocator = deps.RepoLocator.SetBuildpackBitsRepository(bitsRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-buildpack").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
buildpackName = "my-buildpack"
示例8:
"github.com/cloudfoundry/cli/cf/commands/routergroups"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("RouterGroups", func() {
var (
ui *testterm.FakeUI
routingAPIRepo *apifakes.FakeRoutingAPIRepository
deps commandregistry.Dependency
cmd *routergroups.RouterGroups
flagContext flags.FlagContext
repoLocator api.RepositoryLocator
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
minAPIVersionRequirement *requirementsfakes.FakeRequirement
loginRequirement *requirementsfakes.FakeRequirement
routingAPIEndpoingRequirement *requirementsfakes.FakeRequirement
)
BeforeEach(func() {
ui = new(testterm.FakeUI)
routingAPIRepo = new(apifakes.FakeRoutingAPIRepository)
config = testconfig.NewRepositoryWithDefaults()
repoLocator = api.RepositoryLocator{}.SetRoutingAPIRepository(routingAPIRepo)
deps = commandregistry.Dependency{
UI: ui,
Config: config,
示例9:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("UnbindRouteService", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
routeRepo *apifakes.FakeRouteRepository
routeServiceBindingRepo *apifakes.FakeRouteServiceBindingRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
fakeDomain models.DomainFields
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
domainRequirement *requirementsfakes.FakeDomainRequirement
serviceInstanceRequirement *requirementsfakes.FakeServiceInstanceRequirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
示例10:
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/commands/space"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
"github.com/cloudfoundry/cli/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("space command", func() {
var (
ui *testterm.FakeUI
loginReq *requirementsfakes.FakeRequirement
targetedOrgReq *requirementsfakes.FakeTargetedOrgRequirement
reqFactory *requirementsfakes.FakeFactory
deps commandregistry.Dependency
cmd space.ShowSpace
flagContext flags.FlagContext
getSpaceModel *plugin_models.GetSpace_Model
spaceRequirement *requirementsfakes.FakeSpaceRequirement
quotaRepo *spacequotasfakes.FakeSpaceQuotaRepository
)
BeforeEach(func() {
ui = new(testterm.FakeUI)
quotaRepo = new(spacequotasfakes.FakeSpaceQuotaRepository)
repoLocator := api.RepositoryLocator{}
repoLocator = repoLocator.SetSpaceQuotaRepository(quotaRepo)
getSpaceModel = new(plugin_models.GetSpace_Model)
deps = commandregistry.Dependency{
UI: ui,
示例11:
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("bind-service command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *requirementsfakes.FakeFactory
config coreconfig.Repository
serviceBindingRepo *apifakes.FakeServiceBindingRepository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetServiceBindingRepository(serviceBindingRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("bind-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = new(requirementsfakes.FakeFactory)
示例12:
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/requirements/requirementsfakes"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-quota command", func() {
var (
ui *testterm.FakeUI
quotaRepo *quotasfakes.FakeQuotaRepository
requirementsFactory *requirementsfakes.FakeFactory
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetQuotaRepository(quotaRepo)
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("set-quota").SetDependency(deps, pluginCall))
}
runCommand := func(args ...string) bool {
return testcmd.RunCLICommand("set-quota", args, requirementsFactory, updateCommandDependency, false, ui)
}
示例13:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const TIMESTAMP_FORMAT = "2006-01-02T15:04:05.00-0700"
var _ = Describe("events command", func() {
var (
reqFactory *requirementsfakes.FakeFactory
eventsRepo *appeventsfakes.FakeAppEventsRepository
ui *testterm.FakeUI
config *coreconfigfakes.FakeRepository
deps commandregistry.Dependency
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
applicationRequirement *requirementsfakes.FakeApplicationRequirement
cmd *application.Events
)
BeforeEach(func() {
cmd = &application.Events{}
ui = new(testterm.FakeUI)
eventsRepo = new(appeventsfakes.FakeAppEventsRepository)
config = new(coreconfigfakes.FakeRepository)
config.OrganizationFieldsReturns(models.OrganizationFields{Name: "my-org"})
示例14:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CreateRoute", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
configRepo coreconfig.Repository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
spaceRequirement *requirementsfakes.FakeSpaceRequirement
domainRequirement *requirementsfakes.FakeDomainRequirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
deps = commandregistry.Dependency{
UI: ui,
示例15:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("V3Apps", func() {
var (
ui *testterm.FakeUI
routeRepo *apifakes.FakeRouteRepository
configRepo coreconfig.Repository
repository *repositoryfakes.FakeRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
routeRepo = new(apifakes.FakeRouteRepository)
repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo)
repository = new(repositoryfakes.FakeRepository)
repoLocator = repoLocator.SetV3Repository(repository)