當前位置: 首頁>>代碼示例>>Golang>>正文


Golang fakes.FakeCloud類代碼示例

本文整理匯總了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"
	})
開發者ID:mattcui,項目名稱:bosh-init,代碼行數:31,代碼來源:manager_test.go

示例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()
開發者ID:vestel,項目名稱:bosh-init,代碼行數:30,代碼來源:manager_test.go

示例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{
開發者ID:vestel,項目名稱:bosh-init,代碼行數:31,代碼來源:vm_test.go

示例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()
開發者ID:mattcui,項目名稱:bosh-init,代碼行數:32,代碼來源:cloud_stemcell_test.go

示例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)
開發者ID:mattcui,項目名稱:bosh-init,代碼行數:31,代碼來源:manager_test.go

示例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,
		}
開發者ID:mattcui,項目名稱:bosh-init,代碼行數:31,代碼來源:disk_test.go


注:本文中的github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。