本文整理汇总了Golang中github.com/cloudfoundry/bosh-utils/uuid/fakes.FakeGenerator类的典型用法代码示例。如果您正苦于以下问题:Golang FakeGenerator类的具体用法?Golang FakeGenerator怎么用?Golang FakeGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeGenerator类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: init
func init() {
Describe("Agent", func() {
var (
logger boshlog.Logger
handler *fakembus.FakeHandler
platform *fakeplatform.FakePlatform
actionDispatcher *fakeagent.FakeActionDispatcher
jobSupervisor *fakejobsuper.FakeJobSupervisor
specService *fakeas.FakeV1Service
syslogServer *fakesyslog.FakeServer
settingsService *fakesettings.FakeSettingsService
uuidGenerator *fakeuuid.FakeGenerator
timeService *fakeclock.FakeClock
agent Agent
)
BeforeEach(func() {
logger = boshlog.NewLogger(boshlog.LevelNone)
handler = &fakembus.FakeHandler{}
platform = fakeplatform.NewFakePlatform()
actionDispatcher = &fakeagent.FakeActionDispatcher{}
jobSupervisor = fakejobsuper.NewFakeJobSupervisor()
specService = fakeas.NewFakeV1Service()
syslogServer = &fakesyslog.FakeServer{}
settingsService = &fakesettings.FakeSettingsService{}
uuidGenerator = &fakeuuid.FakeGenerator{}
timeService = fakeclock.NewFakeClock(time.Now())
agent = New(
logger,
handler,
platform,
actionDispatcher,
jobSupervisor,
specService,
syslogServer,
5*time.Millisecond,
settingsService,
uuidGenerator,
timeService,
)
})
Describe("Run", func() {
It("lets dispatcher handle requests arriving via handler", func() {
err := agent.Run()
Expect(err).ToNot(HaveOccurred())
expectedResp := boshhandler.NewValueResponse("pong")
actionDispatcher.DispatchResp = expectedResp
req := boshhandler.NewRequest("fake-reply", "fake-action", []byte("fake-payload"))
resp := handler.RunFunc(req)
Expect(actionDispatcher.DispatchReq).To(Equal(req))
Expect(resp).To(Equal(expectedResp))
})
It("resumes persistent actions *before* dispatching new requests", func() {
resumedBeforeStartingToDispatch := false
handler.RunCallBack = func() {
resumedBeforeStartingToDispatch = actionDispatcher.ResumedPreviouslyDispatchedTasks
}
err := agent.Run()
Expect(err).ToNot(HaveOccurred())
Expect(resumedBeforeStartingToDispatch).To(BeTrue())
})
Context("when heartbeats can be sent", func() {
BeforeEach(func() {
handler.KeepOnRunning()
})
BeforeEach(func() {
jobName := "fake-job"
nodeID := "node-id"
jobIndex := 1
specService.Spec = boshas.V1ApplySpec{
JobSpec: boshas.JobSpec{Name: &jobName},
Index: &jobIndex,
NodeID: nodeID,
}
jobSupervisor.StatusStatus = "fake-state"
platform.FakeVitalsService.GetVitals = boshvitals.Vitals{
Load: []string{"a", "b", "c"},
}
})
expectedJobName := "fake-job"
expectedJobIndex := 1
expectedNodeID := "node-id"
expectedHb := Heartbeat{
Job: &expectedJobName,
Index: &expectedJobIndex,
JobState: "fake-state",
NodeID: expectedNodeID,
Vitals: boshvitals.Vitals{Load: []string{"a", "b", "c"}},
}
//.........这里部分代码省略.........
开发者ID:nimbus-cloud,项目名称:bosh-agent,代码行数:101,代码来源:agent_test.go
示例3:
"strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
boshassert "github.com/cloudfoundry/bosh-utils/assert"
. "github.com/cloudfoundry/bosh-utils/blobstore"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
)
var _ = Describe("externalBlobstore", func() {
var (
fs *fakesys.FakeFileSystem
runner *fakesys.FakeCmdRunner
uuidGen *fakeuuid.FakeGenerator
configPath string
blobstore Blobstore
)
BeforeEach(func() {
fs = fakesys.NewFakeFileSystem()
runner = fakesys.NewFakeCmdRunner()
uuidGen = &fakeuuid.FakeGenerator{}
configPath = filepath.Join("/etc/", "blobstore-fake-provider.json")
blobstore = NewExternalBlobstore("fake-provider", map[string]interface{}{}, fs, runner, uuidGen, configPath)
})
Describe("Validate", func() {
It("external validate writes config file", func() {
options := map[string]interface{}{"fake-key": "fake-value"}
开发者ID:jianqiu,项目名称:bosh-agent,代码行数:31,代码来源:external_blobstore_test.go
示例4:
import (
"errors"
"os"
. "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/ginkgo"
. "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/gomega"
. "github.com/cloudfoundry/bosh-utils/blobstore"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
)
var _ = Describe("localBlobstore", func() {
var (
fs *fakesys.FakeFileSystem
uuidGen *fakeuuid.FakeGenerator
fakeBlobstorePath = "/some/local/path"
blobstore Blobstore
)
BeforeEach(func() {
fs = fakesys.NewFakeFileSystem()
uuidGen = &fakeuuid.FakeGenerator{}
options := map[string]interface{}{"blobstore_path": fakeBlobstorePath}
blobstore = NewLocalBlobstore(fs, uuidGen, options)
})
Describe("Validate", func() {
It("returns no error when blobstore_path is present", func() {
err := blobstore.Validate()
Expect(err).ToNot(HaveOccurred())
})
开发者ID:EMC-CMD,项目名称:bosh-agent,代码行数:32,代码来源:local_blobstore_test.go
示例5: init
func init() {
Describe("asyncTaskService", func() {
var (
uuidGen *fakeuuid.FakeGenerator
service Service
)
BeforeEach(func() {
uuidGen = &fakeuuid.FakeGenerator{}
service = NewAsyncTaskService(uuidGen, boshlog.NewLogger(boshlog.LevelNone))
})
Describe("StartTask", func() {
startAndWaitForTaskCompletion := func(task Task) Task {
service.StartTask(task)
for task.State == StateRunning {
time.Sleep(time.Nanosecond)
task, _ = service.FindTaskWithID(task.ID)
}
return task
}
It("sets return value on a successful task", func() {
runFunc := func() (interface{}, error) { return 123, nil }
task, err := service.CreateTask(runFunc, nil, nil)
Expect(err).ToNot(HaveOccurred())
task = startAndWaitForTaskCompletion(task)
Expect(task.State).To(BeEquivalentTo(StateDone))
Expect(task.Value).To(Equal(123))
Expect(task.Error).To(BeNil())
})
It("sets task error on a failing task", func() {
err := errors.New("fake-error")
runFunc := func() (interface{}, error) { return nil, err }
task, createErr := service.CreateTask(runFunc, nil, nil)
Expect(createErr).ToNot(HaveOccurred())
task = startAndWaitForTaskCompletion(task)
Expect(task.State).To(BeEquivalentTo(StateFailed))
Expect(task.Value).To(BeNil())
Expect(task.Error).To(Equal(err))
})
Describe("CreateTask", func() {
It("can run task created with CreateTask which does not have end func", func() {
ranFunc := false
runFunc := func() (interface{}, error) { ranFunc = true; return nil, nil }
task, err := service.CreateTask(runFunc, nil, nil)
Expect(err).ToNot(HaveOccurred())
startAndWaitForTaskCompletion(task)
Expect(ranFunc).To(BeTrue())
})
It("can run task created with CreateTask which has end func", func() {
ranFunc := false
runFunc := func() (interface{}, error) { ranFunc = true; return nil, nil }
ranEndFunc := false
endFunc := func(Task) { ranEndFunc = true }
task, err := service.CreateTask(runFunc, nil, endFunc)
Expect(err).ToNot(HaveOccurred())
startAndWaitForTaskCompletion(task)
Expect(ranFunc).To(BeTrue())
Expect(ranEndFunc).To(BeTrue())
})
It("returns an error if generate uuid fails", func() {
uuidGen.GenerateError = errors.New("fake-generate-uuid-error")
_, err := service.CreateTask(nil, nil, nil)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-generate-uuid-error"))
})
})
Describe("CreateTaskWithID", func() {
It("can run task created with CreateTaskWithID which does not have end func", func() {
ranFunc := false
runFunc := func() (interface{}, error) { ranFunc = true; return nil, nil }
task := service.CreateTaskWithID("fake-task-id", runFunc, nil, nil)
startAndWaitForTaskCompletion(task)
Expect(ranFunc).To(BeTrue())
})
It("can run task created with CreateTaskWithID which has end func", func() {
ranFunc := false
runFunc := func() (interface{}, error) { ranFunc = true; return nil, nil }
ranEndFunc := false
endFunc := func(Task) { ranEndFunc = true }
//.........这里部分代码省略.........
开发者ID:EMC-CMD,项目名称:bosh-agent,代码行数:101,代码来源:async_task_service_test.go
示例6: rootDesc
func rootDesc() {
var (
repo ReleaseRepo
deploymentStateService DeploymentStateService
fs *fakesys.FakeFileSystem
fakeUUIDGenerator *fakeuuid.FakeGenerator
)
BeforeEach(func() {
logger := boshlog.NewLogger(boshlog.LevelNone)
fs = fakesys.NewFakeFileSystem()
fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
fakeUUIDGenerator.GeneratedUUID = "fake-uuid"
deploymentStateService = NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, "/fake/path")
deploymentStateService.Load()
repo = NewReleaseRepo(deploymentStateService, fakeUUIDGenerator)
})
Describe("List", func() {
Context("when a current release exists", func() {
BeforeEach(func() {
conf, err := deploymentStateService.Load()
Expect(err).ToNot(HaveOccurred())
conf.Releases = []ReleaseRecord{
ReleaseRecord{ID: "fake-guid-a", Name: "fake-name-a", Version: "fake-version-a"},
ReleaseRecord{ID: "fake-guid-b", Name: "fake-name-b", Version: "fake-version-b"},
}
err = deploymentStateService.Save(conf)
Expect(err).ToNot(HaveOccurred())
})
It("returns existing release", func() {
records, err := repo.List()
Expect(err).ToNot(HaveOccurred())
Expect(records).To(Equal([]ReleaseRecord{
{
ID: "fake-guid-a",
Name: "fake-name-a",
Version: "fake-version-a",
},
{
ID: "fake-guid-b",
Name: "fake-name-b",
Version: "fake-version-b",
},
}))
})
})
Context("when there are no releases recorded", func() {
It("returns not found", func() {
records, err := repo.List()
Expect(err).ToNot(HaveOccurred())
Expect(records).To(HaveLen(0))
})
})
Context("when the config service fails to load", func() {
BeforeEach(func() {
fs.ReadFileError = errors.New("kaboom")
})
It("returns an error", func() {
_, err := repo.List()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Loading existing config"))
})
})
})
Describe("Update", func() {
Context("when there are no existing releases", func() {
It("saves the provided releases to the config file", func() {
err := repo.Update([]release.Release{
fakerelease.New("name1", "1"),
fakerelease.New("name2", "2"),
})
Expect(err).ToNot(HaveOccurred())
conf, err := deploymentStateService.Load()
Expect(err).ToNot(HaveOccurred())
Expect(conf.Releases).To(ConsistOf(
ReleaseRecord{ID: "fake-uuid", Name: "name1", Version: "1"},
ReleaseRecord{ID: "fake-uuid", Name: "name2", Version: "2"},
))
})
})
Context("when the existing releases exactly match the provided releases", func() {
BeforeEach(func() {
conf, err := deploymentStateService.Load()
Expect(err).ToNot(HaveOccurred())
conf.Releases = []ReleaseRecord{
ReleaseRecord{ID: "old-uuid", Name: "name1", Version: "1"},
ReleaseRecord{ID: "old-uuid", Name: "name2", Version: "2"},
}
err = deploymentStateService.Save(conf)
Expect(err).ToNot(HaveOccurred())
})
})
//.........这里部分代码省略.........
开发者ID:mattcui,项目名称:bosh-init,代码行数:101,代码来源:release_repo_test.go
示例7: rootDesc
func rootDesc() {
var mockCtrl *gomock.Controller
BeforeEach(func() {
mockCtrl = gomock.NewController(GinkgoT())
})
AfterEach(func() {
mockCtrl.Finish()
})
Describe("Run", func() {
var (
command bicmd.Cmd
fakeFs *fakesys.FakeFileSystem
stdOut *gbytes.Buffer
stdErr *gbytes.Buffer
userInterface biui.UI
sha1Calculator crypto.SHA1Calculator
manifestSHA1 string
mockDeployer *mock_deployment.MockDeployer
mockInstaller *mock_install.MockInstaller
mockInstallerFactory *mock_install.MockInstallerFactory
mockReleaseExtractor *mock_release.MockExtractor
releaseManager birel.Manager
mockRegistryServerManager *mock_registry.MockServerManager
mockRegistryServer *mock_registry.MockServer
mockAgentClient *mock_agentclient.MockAgentClient
mockAgentClientFactory *mock_httpagent.MockAgentClientFactory
mockCloudFactory *mock_cloud.MockFactory
fakeCPIRelease *fakebirel.FakeRelease
logger boshlog.Logger
mockBlobstoreFactory *mock_blobstore.MockFactory
mockBlobstore *mock_blobstore.MockBlobstore
mockVMManagerFactory *mock_vm.MockManagerFactory
fakeVMManager *fakebivm.FakeManager
fakeStemcellExtractor *fakebistemcell.FakeExtractor
mockStemcellManager *mock_stemcell.MockManager
fakeStemcellManagerFactory *fakebistemcell.FakeManagerFactory
fakeReleaseSetParser *fakebirelsetmanifest.FakeParser
fakeInstallationParser *fakebiinstallmanifest.FakeParser
fakeDeploymentParser *fakebideplmanifest.FakeParser
mockLegacyDeploymentStateMigrator *mock_config.MockLegacyDeploymentStateMigrator
setupDeploymentStateService biconfig.DeploymentStateService
fakeDeploymentValidator *fakebideplval.FakeValidator
directorID = "generated-director-uuid"
fakeUUIDGenerator *fakeuuid.FakeGenerator
configUUIDGenerator *fakeuuid.FakeGenerator
fakeStage *fakebiui.FakeStage
deploymentManifestPath string
deploymentStatePath string
cpiReleaseTarballPath string
stemcellTarballPath string
extractedStemcell bistemcell.ExtractedStemcell
expectDeploy *gomock.Call
mbusURL = "http://fake-mbus-user:[email protected]"
releaseSetManifest birelsetmanifest.Manifest
boshDeploymentManifest bideplmanifest.Manifest
installationManifest biinstallmanifest.Manifest
cloud bicloud.Cloud
cloudStemcell bistemcell.CloudStemcell
expectLegacyMigrate *gomock.Call
expectStemcellUpload *gomock.Call
expectStemcellDeleteUnused *gomock.Call
expectCPIReleaseExtract *gomock.Call
expectInstall *gomock.Call
expectNewCloud *gomock.Call
)
BeforeEach(func() {
logger = boshlog.NewLogger(boshlog.LevelNone)
stdOut = gbytes.NewBuffer()
stdErr = gbytes.NewBuffer()
userInterface = biui.NewWriterUI(stdOut, stdErr, logger)
fakeFs = fakesys.NewFakeFileSystem()
fakeFs.EnableStrictTempRootBehavior()
deploymentManifestPath = "/path/to/manifest.yml"
deploymentStatePath = "/path/to/manifest-state.json"
fakeFs.RegisterOpenFile(deploymentManifestPath, &fakesys.FakeFile{
Stats: &fakesys.FakeFileStats{FileType: fakesys.FakeFileTypeFile},
})
fakeFs.WriteFileString(deploymentManifestPath, "")
mockDeployer = mock_deployment.NewMockDeployer(mockCtrl)
mockInstaller = mock_install.NewMockInstaller(mockCtrl)
mockInstallerFactory = mock_install.NewMockInstallerFactory(mockCtrl)
//.........这里部分代码省略.........
开发者ID:mattcui,项目名称:bosh-init,代码行数:101,代码来源:deploy_cmd_test.go
示例8:
. "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
示例9:
var (
fs *fakesys.FakeFileSystem
logger boshlog.Logger
registryServerManager biregistry.ServerManager
releaseManager birel.Manager
mockInstaller *mock_install.MockInstaller
mockInstallerFactory *mock_install.MockInstallerFactory
mockCloudFactory *mock_cloud.MockFactory
mockCloud *mock_cloud.MockCloud
mockAgentClient *mock_agentclient.MockAgentClient
mockAgentClientFactory *mock_httpagent.MockAgentClientFactory
mockReleaseExtractor *mock_release.MockExtractor
mockStateBuilderFactory *mock_instance_state.MockBuilderFactory
mockStateBuilder *mock_instance_state.MockBuilder
mockState *mock_instance_state.MockState
mockBlobstoreFactory *mock_blobstore.MockFactory
mockBlobstore *mock_blobstore.MockBlobstore
fakeStemcellExtractor *fakebistemcell.FakeExtractor
fakeUUIDGenerator *fakeuuid.FakeGenerator
fakeRegistryUUIDGenerator *fakeuuid.FakeGenerator
fakeRepoUUIDGenerator *fakeuuid.FakeGenerator
fakeAgentIDGenerator *fakeuuid.FakeGenerator
fakeSHA1Calculator *fakebicrypto.FakeSha1Calculator
legacyDeploymentStateMigrator biconfig.LegacyDeploymentStateMigrator
deploymentStateService biconfig.DeploymentStateService
vmRepo biconfig.VMRepo
diskRepo biconfig.DiskRepo
stemcellRepo biconfig.StemcellRepo
deploymentRepo biconfig.DeploymentRepo
releaseRepo biconfig.ReleaseRepo
sshTunnelFactory bisshtunnel.Factory
diskManagerFactory bidisk.ManagerFactory
diskDeployer bivm.DiskDeployer
stdOut *gbytes.Buffer
stdErr *gbytes.Buffer
fakeStage *fakebiui.FakeStage
stemcellManagerFactory bistemcell.ManagerFactory
vmManagerFactory bivm.ManagerFactory
applySpec bias.ApplySpec
directorID string
stemcellTarballPath = "/fake-stemcell-release.tgz"
deploymentManifestPath = "/deployment-dir/fake-deployment-manifest.yml"
deploymentStatePath = "/deployment-dir/fake-deployment-manifest-state.json"
stemcellImagePath = "fake-stemcell-image-path"
stemcellCID = "fake-stemcell-cid"
stemcellCloudProperties = biproperty.Map{}
vmCloudProperties = biproperty.Map{}
vmEnv = biproperty.Map{}
diskCloudProperties = biproperty.Map{}
networkInterfaces = map[string]biproperty.Map{
"network-1": biproperty.Map{
"type": "dynamic",
"default": []bideplmanifest.NetworkDefault{"dns", "gateway"},
"cloud_properties": biproperty.Map{},
},
}
agentRunningState = biagentclient.AgentState{JobState: "running"}
mbusURL = "http://fake-mbus-url"
expectHasVM1 *gomock.Call
expectDeleteVM1 *gomock.Call
sshConfig *SSHConfig
)
开发者ID:mattcui,项目名称:bosh-init,代码行数:81,代码来源:deploy_test.go
示例10:
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
)
type manifestFixtures struct {
validManifest string
missingPrivateKeyManifest string
}
var _ = Describe("Parser", func() {
comboManifestPath := "/path/to/fake-deployment-manifest"
releaseSetManifest := birelsetmanifest.Manifest{}
var (
fakeFs *fakesys.FakeFileSystem
fakeUUIDGenerator *fakeuuid.FakeGenerator
parser manifest.Parser
logger boshlog.Logger
fakeValidator *fakes.FakeValidator
fixtures manifestFixtures
)
BeforeEach(func() {
fakeValidator = fakes.NewFakeValidator()
fakeValidator.SetValidateBehavior([]fakes.ValidateOutput{
{Err: nil},
})
fakeFs = fakesys.NewFakeFileSystem()
logger = boshlog.NewLogger(boshlog.LevelNone)
fakeUUIDGenerator = fakeuuid.NewFakeGenerator()
parser = manifest.NewParser(fakeFs, fakeUUIDGenerator, logger, fakeValidator)
fixtures = manifestFixtures{
validManifest: `
---
开发者ID:mattcui,项目名称:bosh-init,代码行数:32,代码来源:parser_test.go
示例11:
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
示例12:
"io/ioutil"
"strings"
fakeboshdavcli "github.com/cloudfoundry/bosh-davcli/client/fakes"
. "github.com/cloudfoundry/bosh-init/blobstore"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
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("Blobstore", func() {
var (
fakeDavClient *fakeboshdavcli.FakeClient
fakeUUIDGenerator *fakeuuid.FakeGenerator
fs *fakesys.FakeFileSystem
blobstore Blobstore
)
BeforeEach(func() {
fakeDavClient = fakeboshdavcli.NewFakeClient()
fakeUUIDGenerator = fakeuuid.NewFakeGenerator()
fs = fakesys.NewFakeFileSystem()
logger := boshlog.NewLogger(boshlog.LevelNone)
blobstore = NewBlobstore(fakeDavClient, fakeUUIDGenerator, fs, logger)
})
Describe("Get", func() {
BeforeEach(func() {
fakeFile := fakesys.NewFakeFile("fake-destination-path", fs)
开发者ID:mattcui,项目名称:bosh-init,代码行数:32,代码来源:blobstore_test.go
注:本文中的github.com/cloudfoundry/bosh-utils/uuid/fakes.FakeGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论