本文整理汇总了Golang中github.com/cloudfoundry/bosh-init/blobstore/mocks.MockFactory.EXPECT方法的典型用法代码示例。如果您正苦于以下问题:Golang MockFactory.EXPECT方法的具体用法?Golang MockFactory.EXPECT怎么用?Golang MockFactory.EXPECT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/bosh-init/blobstore/mocks.MockFactory
的用法示例。
在下文中一共展示了MockFactory.EXPECT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
fakeUI = &fakeui.FakeUI{}
fakeStage = fakebiui.NewFakeStage()
mockCloud = mock_cloud.NewMockCloud(mockCtrl)
mockCloudFactory = mock_cloud.NewMockFactory(mockCtrl)
mockCpiInstaller = mock_install.NewMockInstaller(mockCtrl)
mockCpiUninstaller = mock_install.NewMockUninstaller(mockCtrl)
mockInstallerFactory = mock_install.NewMockInstallerFactory(mockCtrl)
fakeInstallation = &fakecmd.FakeInstallation{}
mockBlobstoreFactory = mock_blobstore.NewMockFactory(mockCtrl)
mockBlobstore = mock_blobstore.NewMockBlobstore(mockCtrl)
mockBlobstoreFactory.EXPECT().Create(mbusURL).Return(mockBlobstore, nil).AnyTimes()
mockDeploymentManagerFactory = mock_deployment.NewMockManagerFactory(mockCtrl)
mockDeploymentManager = mock_deployment.NewMockManager(mockCtrl)
mockDeployment = mock_deployment.NewMockDeployment(mockCtrl)
mockReleaseExtractor = mock_release.NewMockExtractor(mockCtrl)
releaseManager = birel.NewManager(logger)
mockAgentClientFactory = mock_httpagent.NewMockAgentClientFactory(mockCtrl)
mockAgentClient = mock_agentclient.NewMockAgentClient(mockCtrl)
mockAgentClientFactory.EXPECT().NewAgentClient(gomock.Any(), gomock.Any()).Return(mockAgentClient).AnyTimes()
directorID = "fake-uuid-0"
示例2: rootDesc
//.........这里部分代码省略.........
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)
mockReleaseExtractor = mock_release.NewMockExtractor(mockCtrl)
releaseManager = birel.NewManager(logger)
mockRegistryServerManager = mock_registry.NewMockServerManager(mockCtrl)
mockRegistryServer = mock_registry.NewMockServer(mockCtrl)
mockAgentClientFactory = mock_httpagent.NewMockAgentClientFactory(mockCtrl)
mockAgentClient = mock_agentclient.NewMockAgentClient(mockCtrl)
mockAgentClientFactory.EXPECT().NewAgentClient(gomock.Any(), gomock.Any()).Return(mockAgentClient).AnyTimes()
mockCloudFactory = mock_cloud.NewMockFactory(mockCtrl)
mockBlobstoreFactory = mock_blobstore.NewMockFactory(mockCtrl)
mockBlobstore = mock_blobstore.NewMockBlobstore(mockCtrl)
mockBlobstoreFactory.EXPECT().Create(mbusURL, gomock.Any()).Return(mockBlobstore, nil).AnyTimes()
mockVMManagerFactory = mock_vm.NewMockManagerFactory(mockCtrl)
fakeVMManager = fakebivm.NewFakeManager()
mockVMManagerFactory.EXPECT().NewManager(gomock.Any(), mockAgentClient).Return(fakeVMManager).AnyTimes()
fakeStemcellExtractor = fakebistemcell.NewFakeExtractor()
mockStemcellManager = mock_stemcell.NewMockManager(mockCtrl)
fakeStemcellManagerFactory = fakebistemcell.NewFakeManagerFactory()
fakeReleaseSetParser = fakebirelsetmanifest.NewFakeParser()
fakeInstallationParser = fakebiinstallmanifest.NewFakeParser()
fakeDeploymentParser = fakebideplmanifest.NewFakeParser()
mockLegacyDeploymentStateMigrator = mock_config.NewMockLegacyDeploymentStateMigrator(mockCtrl)
configUUIDGenerator = &fakeuuid.FakeGenerator{}
configUUIDGenerator.GeneratedUUID = directorID
setupDeploymentStateService = biconfig.NewFileSystemDeploymentStateService(fakeFs, configUUIDGenerator, logger, biconfig.DeploymentStatePath(deploymentManifestPath))
fakeDeploymentValidator = fakebideplval.NewFakeValidator()
fakeStage = fakebiui.NewFakeStage()
sha1Calculator = crypto.NewSha1Calculator(fakeFs)
fakeUUIDGenerator = &fakeuuid.FakeGenerator{}