azuretesting

package
v0.0.0-...-4bd6544 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestRecorder

func RequestRecorder(requests *[]*http.Request) autorest.PrepareDecorator

RequestRecorder returns an autorest.PrepareDecorator that records requests to ghe given slice.

Types

type MockSender

type MockSender struct {
	*mocks.Sender

	// PathPattern, if non-empty, is assumed to be a regular expression
	// that must match the request path.
	PathPattern string
}

MockSender is a wrapper around autorest/mocks.Sender, extending it with request path checking to ease testing.

func NewSenderWithValue

func NewSenderWithValue(v interface{}) *MockSender

NewSenderWithValue returns a *mocks.Sender that marshals the provided object to JSON and sets it as the content. This function will panic if marshalling fails.

func (*MockSender) Do

func (s *MockSender) Do(req *http.Request) (*http.Response, error)

type MockStorageClient

type MockStorageClient struct {
	testing.Stub

	ListBlobsFunc          func(container string, _ storage.ListBlobsParameters) (storage.BlobListResponse, error)
	DeleteBlobIfExistsFunc func(container, name string) (bool, error)
}

func (*MockStorageClient) DeleteBlobIfExists

func (c *MockStorageClient) DeleteBlobIfExists(container, name string, headers map[string]string) (bool, error)

func (*MockStorageClient) GetBlobService

func (c *MockStorageClient) GetBlobService() azurestorage.BlobStorageClient

func (*MockStorageClient) ListBlobs

func (c *MockStorageClient) ListBlobs(
	container string,
	params storage.ListBlobsParameters,
) (storage.BlobListResponse, error)

func (*MockStorageClient) NewClient

func (c *MockStorageClient) NewClient(
	accountName, accountKey, blobServiceBaseURL, apiVersion string,
	useHTTPS bool,
) (azurestorage.Client, error)

NewClient exists to satisfy users who want a NewClientFunc.

type Senders

type Senders []autorest.Sender

Senders is a Sender that includes a collection of Senders, which will be called in sequence.

func (*Senders) Do

func (s *Senders) Do(req *http.Request) (*http.Response, error)

type SerialSender

type SerialSender struct {
	// contains filtered or unexported fields
}

SerialSender is a Sender that permits only one active Do call at a time.

func NewSerialSender

func NewSerialSender(s autorest.Sender) *SerialSender

func (*SerialSender) Do

func (s *SerialSender) Do(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL