本文整理匯總了Golang中github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeCloud類的具體用法?Golang FakeCloud怎麽用?Golang FakeCloud使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeCloud類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
bidisk "github.com/cloudfoundry/bosh-init/deployment/disk"
bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest"
fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
biproperty "github.com/cloudfoundry/bosh-utils/property"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Manager", func() {
var (
manager Manager
fakeCloud *fakebicloud.FakeCloud
fakeFs *fakesys.FakeFileSystem
fakeUUIDGenerator *fakeuuid.FakeGenerator
diskRepo biconfig.DiskRepo
)
BeforeEach(func() {
logger := boshlog.NewLogger(boshlog.LevelNone)
fakeFs = fakesys.NewFakeFileSystem()
fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fakeFs, fakeUUIDGenerator, logger, "/fake/path")
diskRepo = biconfig.NewDiskRepo(deploymentStateService, fakeUUIDGenerator)
managerFactory := NewManagerFactory(diskRepo, logger)
fakeCloud = fakebicloud.NewFakeCloud()
manager = managerFactory.NewManager(fakeCloud)
fakeUUIDGenerator.GeneratedUUID = "fake-uuid"
})
示例2:
fakesys "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/uuid/fakes"
. "github.com/cloudfoundry/bosh-init/internal/github.com/onsi/ginkgo"
. "github.com/cloudfoundry/bosh-init/internal/github.com/onsi/gomega"
bistemcell "github.com/cloudfoundry/bosh-init/stemcell"
)
var _ = Describe("Manager", func() {
var (
fakeCloud *fakebicloud.FakeCloud
manager Manager
logger boshlog.Logger
expectedNetworkInterfaces map[string]biproperty.Map
expectedCloudProperties biproperty.Map
expectedEnv biproperty.Map
deploymentManifest bideplmanifest.Manifest
fakeVMRepo *fakebiconfig.FakeVMRepo
stemcellRepo biconfig.StemcellRepo
fakeDiskDeployer *fakebivm.FakeDiskDeployer
fakeAgentClient *fakebiagentclient.FakeAgentClient
stemcell bistemcell.CloudStemcell
fs *fakesys.FakeFileSystem
)
BeforeEach(func() {
logger = boshlog.NewLogger(boshlog.LevelNone)
fs = fakesys.NewFakeFileSystem()
fakeCloud = fakebicloud.NewFakeCloud()
fakeAgentClient = fakebiagentclient.NewFakeAgentClient()
fakeVMRepo = fakebiconfig.NewFakeVMRepo()
示例3:
fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
fakebiconfig "github.com/cloudfoundry/bosh-init/config/fakes"
fakebidisk "github.com/cloudfoundry/bosh-init/deployment/disk/fakes"
fakebivm "github.com/cloudfoundry/bosh-init/deployment/vm/fakes"
fakebiagentclient "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-agent/agentclient/fakes"
fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
)
var _ = Describe("VM", func() {
var (
vm VM
fakeVMRepo *fakebiconfig.FakeVMRepo
fakeStemcellRepo *fakebiconfig.FakeStemcellRepo
fakeDiskDeployer *fakebivm.FakeDiskDeployer
fakeAgentClient *fakebiagentclient.FakeAgentClient
fakeCloud *fakebicloud.FakeCloud
applySpec bias.ApplySpec
diskPool bideplmanifest.DiskPool
fs *fakesys.FakeFileSystem
logger boshlog.Logger
)
BeforeEach(func() {
fakeAgentClient = fakebiagentclient.NewFakeAgentClient()
// apply spec is only being passed to the agent client, so it doesn't need much content for testing
applySpec = bias.ApplySpec{
Deployment: "fake-deployment-name",
}
diskPool = bideplmanifest.DiskPool{
示例4:
. "github.com/onsi/gomega"
"errors"
bicloud "github.com/cloudfoundry/bosh-init/cloud"
fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
biconfig "github.com/cloudfoundry/bosh-init/config"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
)
var _ = Describe("CloudStemcell", func() {
var (
stemcellRepo biconfig.StemcellRepo
fakeUUIDGenerator *fakeuuid.FakeGenerator
fakeCloud *fakebicloud.FakeCloud
cloudStemcell CloudStemcell
)
BeforeEach(func() {
stemcellRecord := biconfig.StemcellRecord{
CID: "fake-stemcell-cid",
Name: "fake-stemcell-name",
Version: "fake-stemcell-version",
}
fs := fakesys.NewFakeFileSystem()
logger := boshlog.NewLogger(boshlog.LevelNone)
fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, "/fake/path")
stemcellRepo = biconfig.NewStemcellRepo(deploymentStateService, fakeUUIDGenerator)
fakeCloud = fakebicloud.NewFakeCloud()
示例5:
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
fakebistemcell "github.com/cloudfoundry/bosh-init/stemcell/fakes"
fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
)
var _ = Describe("Manager", func() {
var (
stemcellRepo biconfig.StemcellRepo
fakeUUIDGenerator *fakeuuid.FakeGenerator
manager Manager
fs *fakesys.FakeFileSystem
reader *fakebistemcell.FakeStemcellReader
fakeCloud *fakebicloud.FakeCloud
fakeStage *fakebiui.FakeStage
stemcellTarballPath string
tempExtractionDir string
expectedExtractedStemcell ExtractedStemcell
)
BeforeEach(func() {
fs = fakesys.NewFakeFileSystem()
reader = fakebistemcell.NewFakeReader()
logger := boshlog.NewLogger(boshlog.LevelNone)
fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, "/fake/path")
fakeUUIDGenerator.GeneratedUUID = "fake-stemcell-id-1"
stemcellRepo = biconfig.NewStemcellRepo(deploymentStateService, fakeUUIDGenerator)
示例6:
biconfig "github.com/cloudfoundry/bosh-init/config"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
biproperty "github.com/cloudfoundry/bosh-utils/property"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
. "github.com/cloudfoundry/bosh-init/deployment/disk"
)
var _ = Describe("Disk", func() {
var (
disk Disk
diskCloudProperties biproperty.Map
fakeCloud *fakebicloud.FakeCloud
diskRepo biconfig.DiskRepo
fakeUUIDGenerator *fakeuuid.FakeGenerator
)
BeforeEach(func() {
diskCloudProperties = biproperty.Map{
"fake-cloud-property-key": "fake-cloud-property-value",
}
fakeCloud = fakebicloud.NewFakeCloud()
diskRecord := biconfig.DiskRecord{
CID: "fake-disk-cid",
Size: 1024,
CloudProperties: diskCloudProperties,
}