本文整理汇总了Golang中github.com/maximilien/softlayer-go/client/fakes.FakeSoftLayerClient类的典型用法代码示例。如果您正苦于以下问题:Golang FakeSoftLayerClient类的具体用法?Golang FakeSoftLayerClient怎么用?Golang FakeSoftLayerClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeSoftLayerClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SetTestFixturesForFakeSoftLayerClient
func SetTestFixturesForFakeSoftLayerClient(fakeSoftLayerClient *fakesslclient.FakeSoftLayerClient, fileNames []string) {
workingDir, err := os.Getwd()
Expect(err).ToNot(HaveOccurred())
for _, fileName := range fileNames {
fileContents, err := ReadJsonTestFixtures(filepath.Join(workingDir, "..", ".."), "softlayer", fileName)
Expect(err).ToNot(HaveOccurred())
fakeSoftLayerClient.DoRawHttpRequestResponses = append(fakeSoftLayerClient.DoRawHttpRequestResponses, fileContents)
}
}
示例2: readJsonTestFixtures
func readJsonTestFixtures(fakeClient *slclientfakes.FakeSoftLayerClient) {
blockDeviceTemplateGroups, err := common.ReadJsonTestFixtures("services", "SoftLayer_Account_Service_getBlockDeviceTemplateGroups.json")
Expect(err).ToNot(HaveOccurred())
getObject, err := common.ReadJsonTestFixtures("services", "SoftLayer_Virtual_Guest_Block_Device_Template_Group_Service_getObject.json")
Expect(err).ToNot(HaveOccurred())
getDatacenters, err := common.ReadJsonTestFixtures("services", "SoftLayer_Virtual_Guest_Block_Device_Template_Group_Service_getDatacenters.json")
Expect(err).ToNot(HaveOccurred())
fakeClient.DoRawHttpRequestResponses = [][]byte{blockDeviceTemplateGroups, getObject, getDatacenters}
}
示例3:
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Product_Order", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
productOrderService softlayer.SoftLayer_Product_Order_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
productOrderService, err = fakeClient.GetSoftLayer_Product_Order_Service()
示例4:
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/maximilien/bosh-softlayer-cpi/softlayer/stemcell"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
testhelpers "github.com/maximilien/bosh-softlayer-cpi/test_helpers"
fakesslclient "github.com/maximilien/softlayer-go/client/fakes"
)
var _ = Describe("SoftLayerStemcell", func() {
var (
softLayerClient *fakesslclient.FakeSoftLayerClient
stemcell SoftLayerStemcell
logger boshlog.Logger
)
BeforeEach(func() {
softLayerClient = fakesslclient.NewFakeSoftLayerClient("fake-username", "fake-api-key")
logger = boshlog.NewLogger(boshlog.LevelNone)
stemcell = NewSoftLayerStemcell(1234, "fake-stemcell-uuid", DefaultKind, softLayerClient, logger)
})
Describe("#Delete", func() {
BeforeEach(func() {
fixturesFileNames := []string{"SoftLayer_Virtual_Guest_Block_Device_Template_Group_Service_Delete.json",
"SoftLayer_Virtual_Guest_Service_getActiveTransaction.json",
示例5:
import (
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Account_Service", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
accountService softlayer.SoftLayer_Account_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
accountService, err = fakeClient.GetSoftLayer_Account_Service()
示例6:
import (
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
common "github.com/maximilien/softlayer-go/common"
softlayer "github.com/maximilien/softlayer-go/softlayer"
)
var _ = Describe("SoftLayer_Network_Storage", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
networkStorageService softlayer.SoftLayer_Network_Storage_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
networkStorageService, err = fakeClient.GetSoftLayer_Network_Storage_Service()
示例7:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Ssh_Key_Service", func() {
var (
username, apiKey string
err error
fakeClient *slclientfakes.FakeSoftLayerClient
sshKeyService softlayer.SoftLayer_Security_Ssh_Key_Service
sshKey datatypes.SoftLayer_Security_Ssh_Key
sshKeyTemplate datatypes.SoftLayer_Security_Ssh_Key
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
示例8:
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Network_Storage", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
networkStorageService softlayer.SoftLayer_Network_Storage_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
networkStorageService, err = fakeClient.GetSoftLayer_Network_Storage_Service()
示例9:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Virtual_Disk_Image_Service", func() {
var (
username, apiKey string
err error
fakeClient *slclientfakes.FakeSoftLayerClient
virtualDiskImageService softlayer.SoftLayer_Virtual_Disk_Image_Service
virtualDiskImage datatypes.SoftLayer_Virtual_Disk_Image
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
示例10:
import (
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
common "github.com/maximilien/softlayer-go/common"
softlayer "github.com/maximilien/softlayer-go/softlayer"
)
var _ = Describe("SoftLayer_Product_Package", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
productPackageService softlayer.SoftLayer_Product_Package_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
productPackageService, err = fakeClient.GetSoftLayer_Product_Package_Service()
示例11:
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Hardware", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
hardwareService softlayer.SoftLayer_Hardware_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
hardwareService, err = fakeClient.GetSoftLayer_Hardware_Service()
示例12:
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Dns_Domain_Record", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
dnsDomainResourceRecordService softlayer.SoftLayer_Dns_Domain_ResourceRecord_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())
dnsDomainResourceRecordService, err = fakeClient.GetSoftLayer_Dns_Domain_ResourceRecord_Service()
示例13:
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Dns_Domain", func() {
var (
username, apiKey string
fakeClient *slclientfakes.FakeSoftLayerClient
dnsDomainService softlayer.SoftLayer_Dns_Domain_Service
err error
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).NotTo(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).NotTo(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).NotTo(BeNil())
dnsDomainService, err = fakeClient.GetSoftLayer_Dns_Domain_Service()
示例14:
testhelpers "github.com/cloudfoundry/bosh-softlayer-cpi/test_helpers"
fakesutil "github.com/cloudfoundry/bosh-softlayer-cpi/util/fakes"
fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
fakeslclient "github.com/maximilien/softlayer-go/client/fakes"
softlayer "github.com/maximilien/softlayer-go/softlayer"
. "github.com/cloudfoundry/bosh-softlayer-cpi/softlayer/vm"
)
var _ = Describe("SoftlayerFileService", func() {
var (
logger boshlog.Logger
softLayerClient *fakeslclient.FakeSoftLayerClient
sshClient *fakesutil.FakeSshClient
fs *fakesys.FakeFileSystem
uuidGenerator *fakeuuid.FakeGenerator
softlayerFileService SoftlayerFileService
)
BeforeEach(func() {
logger = boshlog.NewLogger(boshlog.LevelNone)
softLayerClient = fakeslclient.NewFakeSoftLayerClient("fake-username", "fake-api-key")
sshClient = fakesutil.NewFakeSshClient()
uuidGenerator = fakeuuid.NewFakeGenerator()
fs = fakesys.NewFakeFileSystem()
testhelpers.SetTestFixtureForFakeSoftLayerClient(softLayerClient, "SoftLayer_Virtual_Guest_Service_getObject.json")
})
Describe("Upload", func() {
示例15:
. "github.com/onsi/gomega"
slclientfakes "github.com/maximilien/softlayer-go/client/fakes"
datatypes "github.com/maximilien/softlayer-go/data_types"
softlayer "github.com/maximilien/softlayer-go/softlayer"
testhelpers "github.com/maximilien/softlayer-go/test_helpers"
)
var _ = Describe("SoftLayer_Virtual_Guest_Service", func() {
var (
username, apiKey string
err error
fakeClient *slclientfakes.FakeSoftLayerClient
virtualGuestService softlayer.SoftLayer_Virtual_Guest_Service
virtualGuest datatypes.SoftLayer_Virtual_Guest
virtualGuestTemplate datatypes.SoftLayer_Virtual_Guest_Template
reload_OS_Config datatypes.Image_Template_Config
)
BeforeEach(func() {
username = os.Getenv("SL_USERNAME")
Expect(username).ToNot(Equal(""))
apiKey = os.Getenv("SL_API_KEY")
Expect(apiKey).ToNot(Equal(""))
fakeClient = slclientfakes.NewFakeSoftLayerClient(username, apiKey)
Expect(fakeClient).ToNot(BeNil())