本文整理汇总了Golang中github.com/cloudfoundry/cli/testhelpers/requirements.FakeReqFactory.Space方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeReqFactory.Space方法的具体用法?Golang FakeReqFactory.Space怎么用?Golang FakeReqFactory.Space使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/testhelpers/requirements.FakeReqFactory
的用法示例。
在下文中一共展示了FakeReqFactory.Space方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
space.ServiceInstances = services
space.SecurityGroups = securityGroups
space.SpaceQuotaGuid = "runaway-guid"
quota := models.SpaceQuota{}
quota.Guid = "runaway-guid"
quota.Name = "runaway"
quota.MemoryLimit = 102400
quota.InstanceMemoryLimit = -1
quota.RoutesLimit = 111
quota.ServicesLimit = 222
quota.NonBasicServicesAllowed = false
requirementsFactory.LoginSuccess = true
requirementsFactory.TargetedOrgSuccess = true
requirementsFactory.Space = space
quotaRepo.FindByGuidReturns(quota, nil)
})
Context("when the space has a space quota", func() {
It("shows information about the given space", func() {
runCommand("whose-space-is-it-anyway")
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Getting info for space", "whose-space-is-it-anyway", "my-org", "my-user"},
[]string{"OK"},
[]string{"whose-space-is-it-anyway"},
[]string{"Org", "my-org"},
[]string{"Apps", "app1"},
[]string{"Domains", "domain1"},
[]string{"Services", "service1"},
示例2:
runCommand("my-space")
Expect(ui.FailedWithUsage).To(BeTrue())
})
})
Context("when logged in, targeted a space and given a domain that exists", func() {
BeforeEach(func() {
requirementsFactory.LoginSuccess = true
requirementsFactory.TargetedOrgSuccess = true
requirementsFactory.Domain = models.DomainFields{
Guid: "domain-guid",
Name: "example.com",
}
requirementsFactory.Space = models.Space{SpaceFields: models.SpaceFields{
Guid: "my-space-guid",
Name: "my-space",
}}
})
It("creates routes, obviously", func() {
runCommand("-n", "host", "my-space", "example.com")
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Creating route", "host.example.com", "my-org", "my-space", "my-user"},
[]string{"OK"},
))
Expect(routeRepo.CreateInSpaceHost).To(Equal("host"))
Expect(routeRepo.CreateInSpaceDomainGuid).To(Equal("domain-guid"))
Expect(routeRepo.CreateInSpaceSpaceGuid).To(Equal("my-space-guid"))
})