本文整理匯總了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"))
})