本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes.FakeEndpointRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeEndpointRepository类的具体用法?Golang FakeEndpointRepository怎么用?Golang FakeEndpointRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeEndpointRepository类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Login Command", func() {
var (
Flags []string
Config coreconfig.Repository
ui *testterm.FakeUI
authRepo *authenticationfakes.FakeAuthenticationRepository
endpointRepo *coreconfigfakes.FakeEndpointRepository
orgRepo *organizationsfakes.FakeOrganizationRepository
spaceRepo *apifakes.FakeSpaceRepository
org models.Organization
deps commandregistry.Dependency
minCLIVersion string
minRecommendedCLIVersion string
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = Config
deps.RepoLocator = deps.RepoLocator.SetEndpointRepository(endpointRepo)
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
开发者ID:yingkitw,项目名称:cli,代码行数:31,代码来源:login_test.go
示例2:
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/commands"
"github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Api", func() {
var (
config coreconfig.Repository
endpointRepo *coreconfigfakes.FakeEndpointRepository
deps commandregistry.Dependency
requirementsFactory *requirementsfakes.FakeFactory
ui *testterm.FakeUI
cmd commands.API
flagContext flags.FlagContext
repoLocator api.RepositoryLocator
runCLIErr error
)
callApi := func(args []string) {
err := flagContext.Parse(args...)
Expect(err).NotTo(HaveOccurred())
runCLIErr = cmd.Execute(flagContext)
}
BeforeEach(func() {
ui = new(testterm.FakeUI)
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:api_test.go
示例3:
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)
开发者ID:jasonkeene,项目名称:cli,代码行数:31,代码来源:ssh_code_test.go
示例4:
It("extrapolates the loggregator URL based on the API URL (non-SSL API)", func() {
endpoint := r.LoggregatorEndpoint(ccInfo, "http://127.0.0.1:80")
Expect(endpoint).To(Equal("ws://loggregator.0.0.1:80"))
})
})
})
Describe("Refresh", func() {
BeforeEach(func() {
config := configuration.NewRepositoryWithDefaults()
i18n.T = i18n.Init(config)
})
Context("when the cloud controller returns an insecure api endpoint", func() {
var (
r APIConfigRefresher
ccInfo *CCInfo
endpointRepo *coreconfigfakes.FakeEndpointRepository
)
BeforeEach(func() {
ccInfo = &CCInfo{
LoggregatorEndpoint: "some-endpoint",
}
endpointRepo = new(coreconfigfakes.FakeEndpointRepository)
r = APIConfigRefresher{
EndpointRepo: endpointRepo,
Config: new(coreconfigfakes.FakeReadWriter),
Endpoint: "api.some.endpoint.com",
}
})
开发者ID:Reejoshi,项目名称:cli,代码行数:31,代码来源:api_config_refresher_test.go
注:本文中的github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes.FakeEndpointRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论