本文整理匯總了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,