本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/app_instances/fakes.FakeAppInstancesRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeAppInstancesRepository类的具体用法?Golang FakeAppInstancesRepository怎么用?Golang FakeAppInstancesRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeAppInstancesRepository类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
testtime "github.com/cloudfoundry/cli/testhelpers/time"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("app Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
appSummaryRepo *testapi.FakeAppSummaryRepo
appInstancesRepo *testAppInstanaces.FakeAppInstancesRepository
appLogsNoaaRepo *testapi.FakeLogsNoaaRepository
requirementsFactory *testreq.FakeReqFactory
app models.Application
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetLogsNoaaRepository(appLogsNoaaRepo)
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetAppSummaryRepository(appSummaryRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("app").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
示例2:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("start command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
defaultAppForStart models.Application
defaultInstanceResponses [][]models.AppInstanceFields
defaultInstanceErrorCodes []string
requirementsFactory *testreq.FakeReqFactory
logMessages []*logmessage.LogMessage
logRepo *testapi.FakeLogsRepository
appInstancesRepo *testAppInstanaces.FakeAppInstancesRepository
appRepo *testApplication.FakeApplicationRepository
OriginalAppCommand command_registry.Command
deps command_registry.Dependency
displayApp *appCmdFakes.FakeAppDisplayer
)
updateCommandDependency := func(logsRepo api.LogsRepository) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetLogsRepository(logsRepo)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
示例3:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
testtime "github.com/cloudfoundry/cli/testhelpers/time"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("app Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
appSummaryRepo *testapi.FakeAppSummaryRepo
appInstancesRepo *testAppInstanaces.FakeAppInstancesRepository
requirementsFactory *testreq.FakeReqFactory
app models.Application
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetAppSummaryRepository(appSummaryRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("app").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
示例4:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
testtime "github.com/cloudfoundry/cli/testhelpers/time"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("create-app-manifest Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
appSummaryRepo *testapi.FakeAppSummaryRepo
appInstancesRepo *testAppInstanaces.FakeAppInstancesRepository
requirementsFactory *testreq.FakeReqFactory
fakeManifest *testManifest.FakeAppManifest
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetAppSummaryRepository(appSummaryRepo)
deps.RepoLocator = deps.RepoLocator.SetAppInstancesRepository(appInstancesRepo)
deps.Config = configRepo
deps.AppManifest = fakeManifest
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("create-app-manifest").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
示例5: Execute
type passingRequirement struct{}
func (r passingRequirement) Execute() bool {
return true
}
var _ = Describe("App", func() {
var (
ui *testterm.FakeUI
appSummaryRepo *fakeapi.FakeAppSummaryRepository
appInstancesRepo *fakeappinstances.FakeAppInstancesRepository
getAppModel *plugin_models.GetAppModel
cmd command_registry.Command
deps command_registry.Dependency
factory *fakerequirements.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
targetedSpaceRequirement requirements.Requirement
applicationRequirement *fakerequirements.FakeApplicationRequirement
)
BeforeEach(func() {
cmd = &application.ShowApp{}
flagContext = flags.NewFlagContext(cmd.MetaData().Flags)
ui = &testterm.FakeUI{}
ui.InputsChan = make(chan string)
示例6:
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/command_registry"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("restart-app-instance", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
appInstancesRepo *testApplication.FakeAppInstancesRepository
requirementsFactory *testreq.FakeReqFactory
application models.Application
deps command_registry.Dependency
)
BeforeEach(func() {
application = models.Application{}
application.Name = "my-app"
application.Guid = "my-app-guid"
application.InstanceCount = 1
ui = &testterm.FakeUI{}
appInstancesRepo = &testApplication.FakeAppInstancesRepository{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{
LoginSuccess: true,